Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clickhouse - is it possible to Alter table in a cluster in 1 command

I have a scenario where we need to add columns on a table which exists in several different Clickhouse nodes and queried by a distributed table .

Is there a way to alter that table in all servers, using a single alter command? meaning that the alter command will propagate to all various instances and fail completely if one node fails to commit alter? or do I need to develop a mechanism which knows to run alter on each node, and rollback if one node fails to commit alter?

like image 552
roee zi Avatar asked Jan 31 '26 05:01

roee zi


1 Answers

alter table xxx on cluster my_cluster add column x Int64;

alter table xxx_dist on cluster my_cluster add column x Int64;

like image 72
Denny Crane Avatar answered Feb 02 '26 23:02

Denny Crane



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!