Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Renaming Columns #146

Closed
fasterharder opened this issue Oct 22, 2016 · 9 comments
Closed

FR: Renaming Columns #146

fasterharder opened this issue Oct 22, 2016 · 9 comments
Labels

Comments

@fasterharder
Copy link

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.

@alexey-milovidov
Copy link
Member

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.

@fizerkhan
Copy link

fizerkhan commented Aug 10, 2018

+1 Do you have any milestone for this feature?

@blinkov
Copy link
Contributor

blinkov commented Aug 10, 2018

@fizerkhan unfortunately, there's no ETA at the moment.

@fizerkhan
Copy link

@blinkov Thanks for the update. Do you have any other method to do it?

@blinkov
Copy link
Contributor

blinkov commented Aug 10, 2018

@fizerkhan workaround is INSERT+SELECT or clickhouse-copier data into a new table with properly named columns

@perez1987
Copy link

@blinkov Is it possible to rename fields between source-destination tables between tables using clickhouse-copier?

@geldot
Copy link
Contributor

geldot commented Jun 7, 2019

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?

@alexey-milovidov
Copy link
Member

Current status: this feature is not in progress and is queued after another feature: non-locking ALTERs.

@alesapin
Copy link
Member

alesapin commented Mar 31, 2020

Feature in this PR: #9948.

@blinkov blinkov closed this as completed Apr 9, 2020
alexey-milovidov pushed a commit that referenced this issue Jul 21, 2020
* I described function randomStringUTF8

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Ive edited en-version and translated function description to Russian.

Co-authored-by: BayoNet <da-daos@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants