

# ALTER TABLE SET TBLPROPERTIES


向表中添加自定义或预定义元数据属性并设置其分配的值。要查看表中的属性，请使用 [SHOW TBLPROPERTIES](show-tblproperties.md) 命令。

Apache Hive [托管表](https://cwiki.apache.org/confluence/display/Hive/Managed+vs.+External+Tables)不受支持，因此设置 `'EXTERNAL'='FALSE'` 没有效果。

## 摘要


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

## 参数


**SET TBLPROPERTIES ('property\$1name' = 'property\$1value' [ , ... ])**  
将要添加的元数据属性指定为 `property_name`，将每个属性的值指定为 `property value`。如果 `property_name` 已存在，其值将设置为新指定的 `property_value`。  
以下预定义表属性具有特殊用途。    
****    
[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/athena/latest/ug/alter-table-set-tblproperties.html)

## 示例


以下示例将为表属性添加一条注释。

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

以下示例将修改表 `existing_table` 以使用 Parquet 文件格式以及 ZSTD 压缩和 ZSTD 压缩级别 4。

```
ALTER TABLE existing_table 
SET TBLPROPERTIES ('parquet.compression' = 'ZSTD', 'compression_level' = 4)
```