Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

ALTER TABLE ADD COLUMNS

Focus mode
ALTER TABLE ADD COLUMNS - Amazon Athena

Adds one or more columns to an existing table. When the optional PARTITION syntax is used, updates partition metadata.

Synopsis

ALTER TABLE table_name [PARTITION (partition_col1_name = partition_col1_value [,partition_col2_name = partition_col2_value][,...])] ADD COLUMNS (col_name data_type)

Parameters

PARTITION (partition_col_name = partition_col_value [,...])

Creates a partition with the column name/value combinations that you specify. Enclose partition_col_value in quotation marks only if the data type of the column is a string.

ADD COLUMNS (col_name data_type [,col_name data_type,...])

Adds columns after existing columns but before partition columns.

Examples

ALTER TABLE events ADD COLUMNS (eventowner string)
ALTER TABLE events PARTITION (awsregion='us-west-2') ADD COLUMNS (event string)
ALTER TABLE events PARTITION (awsregion='us-west-2') ADD COLUMNS (eventdescription string)

Notes

  • To see a new table column in the Athena Query Editor navigation pane after you run ALTER TABLE ADD COLUMNS, manually refresh the table list in the editor, and then expand the table again.

  • ALTER TABLE ADD COLUMNS does not work for columns with the date datatype. To workaround this issue, use the timestamp datatype instead.

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.