ALTER TABLE CHANGE COLUMN - Amazon Athena
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

ALTER TABLE CHANGE COLUMN

Changes the name, type, order, or comment for a column in a table.

Synopsis

ALTER TABLE [db_name.]table_name CHANGE [COLUMN] col_old_name col_new_name column_type [COMMENT col_comment] [FIRST|AFTER column_name]

Examples

The following example changes the column name area to zip, makes the data type integer, and places the renamed column after the id column.

ALTER TABLE example_table CHANGE COLUMN area zip int AFTER id

The following example adds a comment to the zip column in the metadata for example_table. To see the comment, use the Amazon CLI aws athena get-table-metadata command or visit the schema for the table in the Amazon Glue console.

ALTER TABLE example_table CHANGE COLUMN zip zip int COMMENT 'USA zipcode'