forked from docs/doc-exports
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
4.4 KiB
4.4 KiB
Changing the Column Name
Function
The ALTER TABLE ... RENAME COLUMN command is used to change the column name.
Syntax
ALTER TABLE tableName RENAME COLUMN old_columnName TO new_columnName
Parameter Description
Parameter |
Description |
---|---|
tableName |
Table name. |
old_columnName |
Old column name. |
new_columnName |
New column name. |
Example
ALTER TABLE table1 RENAME COLUMN a.b.c TO x
a.b.c indicates the full path of a nested column. For details about the nested column rules, see Adding a Column.
Response
You can run the DESCRIBE command to view the new column name.
Parent topic: SparkSQL Schema Evolution and Syntax Description