Support only *MergeTree
, Merge及
Distributed表
改变表结构:
ALTER TABLE [db].name [ON CLUSTER cluster] ADD|DROP|MODIFY COLUMN ... 添加列ADD COLUMN name [type] [default_expr] [AFTER name_after]
As specified after name_after, the designated column is added to the back, to the end of the table or add columns, the table can not add the first column
Adding gold column table structure changes, alter the data is not added to the hard disk, when no data is read to the default value
DROP COLUMN name immediately deleted
MODIFY COLUMN name [type] [default_expr] or change the type of the column default expression, change the type of data to follow changes: With a temporary table
alter table lock, reading and writing alter the same lock can not compete
Does not change the character table, distributed tables alte need each server to perform again
https://clickhouse.yandex/docs/zh/query_language/alter/ not stand it anymore [laughs (wu) cry (nai)]