更新时间:2024-05-30 GMT+08:00
分享

COMPACTION

命令功能

压缩( compaction)用于在 MergeOnRead表将基于行的log日志文件转化为parquet列式数据文件,用于加快记录的查找。

命令格式

SCHEDULE COMPACTION on tableIdentifier |tablelocation;

SHOW COMPACTION on tableIdentifier |tablelocation;

RUN COMPACTION on tableIdentifier |tablelocation [at instant-time];

参数描述

表1 COMPACTION参数

参数

描述

tableIdentifier

在其中执行删除操作的Hudi表的名称。

tablelocation

Hudi表的存储路径

instant-time

执行show compaction命令可以看到instant-time

示例

schedule compaction  on h1;
show compaction on h1;
run compaction on h1 at 20210915170758;

schedule compaction  on '/tmp/hudi/h1';
run compaction on '/tmp/hudi/h1';

注意事项

使用hudi-cli或API方式对SQL创建的Hudi表触发Compaction时需要添加参数hoodie.payload.ordering.fieldpreCombineField的值。

系统响应

可在driver日志和客户端中查看命令运行成功或失败。

分享:

    相关文档

    相关产品