Hello!
Thank you for the great DBMS!
It would be nice to have support of renaming columns. For example:
ALTER TABLE table_name
RENAME [ COLUMN ] column_name TO new_column_name;
or
RENAME COLUMN table_name.column_name TO new_column_name;
Now we have to create a new table, copy the data to it using the INSERT SELECT, rename table to the old name. It can takes a lot of time.
We have this feature request from other customers too.
Implementation is not trivial, because ALTERs that changing columns are processed outside of usual replication queue, and adding rename without reworking of ALTERs will introduce race conditions in replicated tables.
+1 Do you have any milestone for this feature?
@fizerkhan unfortunately, there's no ETA at the moment.
@blinkov Thanks for the update. Do you have any other method to do it?
@fizerkhan workaround is INSERT+SELECT or clickhouse-copier data into a new table with properly named columns
@blinkov Is it possible to rename fields between source-destination tables between tables using clickhouse-copier?
We have this feature request from other customers too.
Implementation is not trivial, because ALTERs that changing columns are processed outside of usual replication queue, and adding rename without reworking of ALTERs will introduce race conditions in replicated tables.
Column rename on simple non-replicated tables would be very welcome for prototyping and single workstation data science workflows. Any pointers for how to implement this?
Current status: this feature is not in progress and is queued after another feature: non-locking ALTERs.
Feature in this PR: https://github.com/ClickHouse/ClickHouse/pull/9948.
Most helpful comment
Current status: this feature is not in progress and is queued after another feature: non-locking ALTERs.