Updated on 2025-02-22 GMT+08:00

RENAME COLUMN

Enabling Schema Evolution

Set the following parameter:

hoodie.schema.evolution.enable=true

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

Table 1 Parameter descriptions

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 ADD COLUMNS.

After the column name is changed, the change is automatically synchronized to the column comment. The comment is in rename oldName to newName format.

System Response

You can run the DESCRIBE command to view the new column name.