Description
Supported engines: Presto and SparkSQL
Applicable table: Native Iceberg tables and external tables
Purpose: Add column to data table.
Standard Statement
ALTER TABLE table_name ADD COLUMN column_name1 column_type [COMMENT col_comment] [FIRST|AFTER column_name2]
Parameter
table_name
: Name of the target table
column_name1
: Column to be added
column_type
: Type of the column to be added
col_comment
: Comment for the column to be added
column_name2
: Column followed by the added column
Example
ALTER TABLE `TBL` ADD COLUMN `COL2` STRING COMMENT 'test' AFTER `COL1`
ALTER TABLE `TBL` ADD COLUMN `COL2` STRING COMMENT 'test' FIRST
Was this page helpful?