EMR V3.27.0 and later support some ALTER TABLE operations.

Add a column

  • Scala

    This operation is not supported.

  • SQL
    ALTER TABLE table_name ADD COLUMNS (col_name data_type [COMMENT col_comment], ...)

Modify a column

  • Scala

    This operation is not supported.

  • SQL
    ALTER TABLE table_name CHANGE [COLUMN] col_name col_name data_type [COMMENT col_comment]
    Note You can modify only column comments.

Set table properties

  • Scala

    This operation is not supported.

  • SQL
    ALTER [TABLE] table_name SET TBLPROPERTIES (key1=val1, key2=val2, ...)
    ALTER [TABLE] table_name UNSET TBLPROPERTIES [IF EXISTS] (key1, key2, ...)
    Note If IF EXISTS is not specified in the UNSET clause and one of the specified keys does not exist, an exception is thrown.