有奖捉虫:办公协同&微信生态&物联网文档专题 HOT
在 Hive 中,分区信息是以目录形式出现的。在 Iceberg 中,分区信息记录到最终底层数据文件中,这使得 Iceberg 的分区更加灵活,而且可以随着数据量的变化演变分区策略。在数据湖计算 DLC 中,您可以创建Iceberg 表来使用隐藏分区等特性。
说明:
原生表默认为 Iceberg 表,外部表根据文件格式可以选择 Hive 表或者 Iceberg 表,详细语法参考文档CREATE TABLE
隐藏式分区您在插入和查询数据时,不需要像 Hive 一样额外指定分区信息。
Iceberg 分区策略支持使用以下函数,不同字段及对应的分区转换策略如下表:
分区策略
字段类型
结果类型
identity
任何
源类型
bucket
int, long, decimal, date, time, timestamp, timestamptz, string, uuid, fixed, binary
int
truncate
int, long, decimal, string
源类型
year
date, timestamp, timestamptz
int
month
date, timestamp, timestamptz
int
day
date, timestamp, timestamptz
date
hour
timestamp, timestamptz
int