ALTER MODIFY ORDER BY 报错

发布于 1 个月前 作者 wpepec 181 次浏览 来自 问答

1.创表 CREATE TABLE default.test ( id Int64, name String, age UInt64, birthday DateTime ) ENGINE = MergeTree ORDER BY id SETTINGS index_granularity = 8192;

2.修改排序键 ALTER TABLE default.test MODIFY ORDER BY (id,name); 报错: DB::Exception: Existing column name is used in the expression that was added to the sorting key. You can add expressions that use only the newly added columns (version 21.4.6.55 (official build))

3.修改排序键 ALTER TABLE default.test MODIFY ORDER BY name; 报错:DB::Exception: Primary key must be a prefix of the sorting key, but in position 0 its column is id, not name (version 21.4.6.55 (official build))

问啥不能修改排序键,好难啊,大佬,求助

回到顶部