这个配置中的错误是什么,
分区键在HUDI中不起作用,并且在执行upsert时,hudi数据集中的所有记录都会更新。所以不能从表中提取增量。
commonConfig = {'className' : 'org.apache.hudi',
'hoodie.datasource.hive_sync.use_jdbc':'false',
'hoodie.datasource.write.precombine.field': 'hash_value',
'hoodie.datasource.write.recordkey.field': 'hash_value',
'hoodie.datasource.hive_sync.partition_fields':'year,month,day',
'hoodie.datasource.hive_sync.partition_extractor_class': 'org.apache.hudi.hive.MultiPartKeysValueExtractor',
'hoodie.datasource.write.keygenerator.class':'org.apache.hudi.ComplexKeyGenerator',
'hoodie.table.name': 'hudi_account',
'hoodie.consistency.check.enabled': 'true',
'hoodie.datasource.hive_sync.database': 'hudi_db',
'hoodie.datasource.hive_sync.table': 'hudi_account',
'hoodie.datasource.hive_sync.enable': 'true',
'path': 's3://' + args['curated_bucket'] + '/stage_e/hudi_db/hudi_account'}我的用例是使用hudi完成upsert逻辑,使用hudi完成分区。Upsert是部分工作的,因为它更新整个记录集,就像我在原始存储桶中有10k个记录一样,当对1k个记录执行upsert时,它更新所有10k数据的hudi时间。
发布于 2021-11-22 01:46:44
你的分区键改变了吗?默认情况下,hudi不使用全局索引,但在每个分区中,我遇到了与您类似的问题,当我启用全局索引时,它是有效的。尝试添加以下设置:
"hoodie.index.type": "GLOBAL_BLOOM", # This is required if we want to ensure we upsert a record, even if the partition changes
"hoodie.bloom.index.update.partition.path": "true", # This is required to write the data into the new partition (defaults to false in 0.8.0, true in 0.9.0)我在这个博客上找到了答案:https://dacort.dev/posts/updating-partition-values-with-apache-hudi/
在这里你可以看到更多关于hudi索引的信息:https://hudi.apache.org/blog/2020/11/11/hudi-indexing-mechanisms/
https://stackoverflow.com/questions/68970224
复制相似问题