ALTER TABLE SET TBLPROPERTIES - Amazon Athena

ALTER TABLE SET TBLPROPERTIES

Adds custom or predefined metadata properties to a table and sets their assigned values. To see the properties in a table, use the SHOW TBLPROPERTIES command.

Apache Hive Managed tables are not supported, so setting 'EXTERNAL'='FALSE' has no effect.

Synopsis

ALTER TABLE table_name SET TBLPROPERTIES ('property_name' = 'property_value' [ , ... ])

Parameters

SET TBLPROPERTIES ('property_name' = 'property_value' [ , ... ])

Specifies the metadata properties to add as property_name and the value for each as property value. If property_name already exists, its value is set to the newly specified property_value.

The following predefined table properties have special uses.

Predefined Property Description
classification Indicates the data type for AWS Glue. Possible values are csv, parquet, orc, avro, or json. For more information, see the TBLPROPERTIES section of CREATE TABLE.
has_encrypted_data Indicates whether the dataset specified by LOCATION is encrypted. For more information, see the TBLPROPERTIES section of CREATE TABLE and Creating Tables Based on Encrypted Datasets in Amazon S3.
orc.compress Specifies a compression format for data in ORC format. For more information, see ORC SerDe.
parquet.compression Specifies a compression format for data in Parquet format. For more information, see Parquet SerDe.
write.compression Specifies a compression format for data in the textfile or JSON formats. For the Parquet and ORC formats, use the parquet.compression and orc.compress properties respectively.
projection.* Custom properties used in partition projection that allow Athena to know what partition patterns to expect when it runs a query on a table. For more information, see Partition Projection with Amazon Athena.
skip.header.line.count Ignores headers in data when you define a table. For more information, see Ignoring Headers.
storage.location.template Specifies a custom Amazon S3 path template for projected partitions. For more information, see Setting up Partition Projection.

Example

ALTER TABLE orders SET TBLPROPERTIES ('notes'="Please don't drop this table.");