greptimedb
greptimedb copied to clipboard
Alter table supports rename columns
What problem does the new feature solve?
GreptimeDB already supports altering table schema by adding, removing columns or renaming the table name. But we don't support renaming columns.
For example:
ALTER TABLE table_name
RENAME COLUMN old_name TO new_name;
What does the feature do?
Rename a column name by alter
statement.
Implementation challenges
Do we allow renaming a time index column? If so, there are some tricky problems that have to be processed:
- The old data before renaming can be read.
- Flushing and compaction work properly in this case.
It's not done.
Does greptimedb
have plans to support modify
or already have something similar? I'd like to use not only this but also modify:
alter table test_table modify column_name double not null;
I'd like to change null constraint for columns.
I'm afraid column alternation is not an easy task. @evenyag can you confirm that?
Does
greptimedb
have plans to supportmodify
or already have something similar? I'd like to use not only this but also modify:alter table test_table modify column_name double not null;
I'd like to change null constraint for columns.
It is hard to modify a column from nullable to not nullable since existing data may contain null. Changing a not null column to nullable is easier.
I think this is very relevant to https://github.com/GreptimeTeam/greptimedb/issues/3517
I think this is very relevant to #3517
Yes, relevant to column metadata changing.