This command is used to rename an existing table.
ALTER TABLE [db_name.]table_name RENAME TO new_table_name;
Parameter |
Description |
---|---|
db_name |
Database name. If this parameter is not specified, the current database is selected. |
table_name |
Current name of the existing table |
new_table_name |
New name of the existing table |
ALTER TABLE carbon RENAME TO carbondata;
ALTER TABLE test_db.carbon RENAME TO test_db.carbondata;
The new table name will be displayed in the CarbonData folder. You can run SHOW TABLES to view the new table name.