一、SQL操作
1、创建表
use hadoop_prod;
create database default;
use default;
CREATE TABLE hadoop_prod.default.sample1 (
id bigint COMMENT 'unique id',
data string)
USING iceberg;
>PARTITIONED BY (partition-expressions) :配置分区
>LOCATION '(fully-qualified-uri)' :指定表路径
>COMMENT 'table documentation' :配置表备注
>TBLPROPERTIES ('key'='value', ...) :配置表属性
表属性:https://iceberg.apache.org/docs/latest/configuration/
对Iceberg表的每次更改都会生成一个新的元数据文件(json文件)以提供原子性。默认情况下,旧元数据文件作为历史文件保存不会删除。
如果要自动清除元数据文件,在表属性中设置write.metadata.delete-after-commit.enabled=true。这将保留一些元数据文件(直到write.metadata.prev