clickhouse

How to rename field in Clickhouse if it ordering key?


Table was created with order by expression and with field name that i need to rename. Is it possible? And here i mean renaming in place without table recreation and data transferring, and data lost.


Solution

  • Unfortunately, renaming a column that is part of the primary key is not possible at this time. This restriction is documented here. Likewise, it is not possible to remove a column in the primary key and to re-add it with a different name (or modify the primary key otherwise (GitHub issue).