【发布时间】:2020-03-27 18:59:34
【问题描述】:
我在 hive 中创建了一个表来测试压缩,
CREATE TABLE part_test(id int, name string, city string) PARTITIONED BY (dept string) clustered by (city) into 5 buckets stored as orc TBLPROPERTIES('transactional'='true');
在屏幕截图中,我们可以看到创建了许多 delta 目录(大约 12 个文件)。
压缩是自动启动的,但它没有运行或压缩增量目录。以下是我们在 hive 中设置的属性。
set hive.compactor.initiator.on=true;
set hive.compactor.worker.threads=1;
set hive.compactor.delta.pct.threshold=0.1f;
set hive.compactor.delta.num.threshold=10;
set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.enforce.bucketing=true;
在屏幕截图 2 中,我们可以看到压缩状态已启动但已超过一天未执行。 我们如何使压缩工作?我们还需要设置其他属性吗?
【问题讨论】:
标签: hadoop hive bigdata hiveql hdp