ClickHouse 对列操作的限制

我在 CH 文档中发现列操作有一些限制。

For tables that don’t store data themselves (such as Merge and Distributed),ALTER just changes the table structure,and does not change the structure of subordinate tables. For example,when running ALTER for a Distributed table,you will also need to run ALTER for the tables on all remote servers.

这里我有问题..你有一些自动运行它的解决方案吗?我在容器上创建了 4 台服务器,我不想在每台服务器上登录并手动执行它,例如 ALTER ... itd。

niaoren123456ZJJ1988 回答:ClickHouse 对列操作的限制

嗯只要暴露端口并编写可以通过每个容器并运行命令的脚本。 ?

在 Python ClickHouse 中有驱动程序。

from clickhouse_driver import Client
client = Client('localhost',port=8090,user='admin',password='admin')

并在端口上进行迭代。

,

运行ALTER TABLE db.table ADD COLUMN ... ON CLUSTER 'cluster-name'

第一部分为基础 Engine=ReplicatedMergeTree(...) 表,第二部分为 Engine=Distributed(...)

本文链接:https://www.f2er.com/370830.html

大家都在问