yihua commented on code in PR #12939:
URL: https://github.com/apache/hudi/pull/12939#discussion_r1988104201


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/index/bloom/SparkHoodieBloomIndexHelper.java:
##########
@@ -171,8 +170,10 @@ public HoodiePairData<HoodieKey, HoodieRecordLocation> 
findMatchingFilesForRecor
           .map(Tuple2::_1)
           .mapPartitions(new HoodieSparkBloomIndexCheckFunction(hoodieTable, 
config), true);
     } else if (config.isBloomIndexFileGroupIdKeySortingEnabled()) {
+      long totalComparisons = fileComparisonsRDD.count();
+      int parallelismForSortPartitioner = (int) Math.max(1L, totalComparisons 
/ config.getBloomIndexKeysPerBucket());
       keyLookupResultRDD = fileComparisonsRDD.mapToPair(fileGroupAndRecordKey 
-> new Tuple2<>(fileGroupAndRecordKey, false))
-          .sortByKey(new FileGroupIdAndRecordKeyComparator(), true, 
targetParallelism)
+          .sortByKey(new FileGroupIdAndRecordKeyComparator(), true, 
parallelismForSortPartitioner)

Review Comment:
   Possible to add a test on the new sorting behavior?



-- 
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]

Reply via email to