簡體   English   中英

列操作中的 ClickHouse 限制

[英]ClickHouse limitations in column manipulation

我在 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。

嗯,只需暴露端口並編寫可以通過每個容器 go 的腳本並運行命令。 ?

在 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(...)表的第二部分

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM