ALTER-TABLE-RENAME
ALTER-TABLE-RENAMEβ
Nameβ
ALTER TABLE RENAME
Descriptionβ
This statement is used to rename certain names of existing table properties. This operation is synchronous, and the return of the command indicates the completion of the execution.
grammar:
ALTER TABLE [database.]table alter_clause;
The alter_clause of rename supports modification of the following names
- Modify the table name
grammar:
RENAME new_table_name;
Modify the rollup index name
grammar:
RENAME ROLLUP old_rollup_name new_rollup_name;
- Modify the partition name
grammar:
RENAME PARTITION old_partition_name new_partition_name;
- Modify the column name
Tips
This feature is supported since the Apache Doris 1/2 version
Modify the column name
grammar:
RENAME COLUMN old_column_name new_column_name;
Notice:
- When creating a table, you need to set 'light_schema_change=true' in the property.
Exampleβ
- Modify the table named table1 to table2
ALTER TABLE table1 RENAME table2;
- Modify the rollup index named rollup1 in the table example_table to rollup2
ALTER TABLE example_table RENAME ROLLUP rollup1 rollup2;
- Modify the partition named p1 in the table example_table to p2
ALTER TABLE example_table RENAME PARTITION p1 p2;
- Modify the column named c1 in the table example_table to c2
ALTER TABLE example_table RENAME COLUMN c1 c2;
Keywordsβ
ALTER, TABLE, RENAME, ALTER TABLE