Flink on Hudi作业参数建议
Hudi表作为Source表时建议设置限流
Hudi表作为Source表,防止上限超过流量峰值,导致作业出现异常带来不稳定因素,因此建议设置限流,限流上限应该为业务上线压测的峰值。
使用时需添加如下参数:
'read.rate.limit' = '1000'
设置execution.checkpointing.tolerable-failed-checkpoints
Flink On Hudi作业建议设置Checkpoint容忍次数多次,如100。
Flink读写Hudi分区表时建议开启hive风格分区配置
如果不开启,则不支持Spark和Flink混合使用。
【示例】
CREATE TABLE stream_mor( id int, name VARCHAR(20), age INT, `date` VARCHAR(20) ) PARTITIONED BY (`date`) WITH ( 'connector' = 'hudi', 'path' = 'hdfs://hacluster/tmp/hudi_mor', 'table.type' = 'MERGE_ON_READ', 'hoodie.datasource.write.recordkey.field' = 'id', 'write.precombine.field' = 'age', 'index.type' = 'BUCKET', 'hoodie.datasource.write.hive_style_partitioning' = 'true', 'hive_sync.partition_extractor_class' = 'org.apache.hudi.hive.MultiPartKeysValueExtractor', 'hoodie.bucket.index.num.buckets' = '4', 'write.tasks' = '4' );