danny0405 commented on code in PR #13017:
URL: https://github.com/apache/hudi/pull/13017#discussion_r2015181976
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/HoodieSimpleBucketIndex.java:
##########
@@ -152,14 +153,18 @@ protected Function<HoodieRecord,
Option<HoodieRecordLocation>> getIndexLocationF
private class SimpleBucketIndexLocationFunction implements
Function<HoodieRecord, Option<HoodieRecordLocation>> {
private final Map<Integer, HoodieRecordLocation> bucketIdToFileIdMapping;
+ private final NumBucketsFunction numBucketsFunction;
public SimpleBucketIndexLocationFunction(HoodieTable table, String
partitionPath) {
this.bucketIdToFileIdMapping =
loadBucketIdToFileIdMappingForPartition(table, partitionPath);
+ HoodieWriteConfig writeConfig = table.getConfig();
+ this.numBucketsFunction = new
NumBucketsFunction(writeConfig.getBucketIndexPartitionExpression(),
+ writeConfig.getBucketIndexPartitionRuleType(),
writeConfig.getBucketIndexNumBuckets());
Review Comment:
can we add a factory method `NumBucketsFunction.fromWriteConfig` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]