the-other-tim-brown commented on code in PR #10578:
URL: https://github.com/apache/hudi/pull/10578#discussion_r1592677106


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/simple/HoodieGlobalSimpleIndex.java:
##########
@@ -68,21 +68,19 @@ public <R> HoodieData<HoodieRecord<R>> tagLocation(
   protected <R> HoodieData<HoodieRecord<R>> tagLocationInternal(
       HoodieData<HoodieRecord<R>> inputRecords, HoodieEngineContext context,
       HoodieTable hoodieTable) {
-    List<Pair<String, HoodieBaseFile>> latestBaseFiles = 
getAllBaseFilesInTable(context, hoodieTable);
+    HoodieData<Pair<String, HoodieBaseFile>> latestBaseFiles = 
getAllBaseFilesInTable(context, hoodieTable);
     HoodiePairData<String, HoodieRecordGlobalLocation> allKeysAndLocations =
-        fetchRecordGlobalLocations(context, hoodieTable, 
config.getGlobalSimpleIndexParallelism(), latestBaseFiles);
+        fetchRecordGlobalLocations(hoodieTable, 
config.getGlobalSimpleIndexParallelism(), latestBaseFiles);
     boolean mayContainDuplicateLookup = 
hoodieTable.getMetaClient().getTableType() == MERGE_ON_READ;
     boolean shouldUpdatePartitionPath = 
config.getGlobalSimpleIndexUpdatePartitionPath() && hoodieTable.isPartitioned();
     return tagGlobalLocationBackToRecords(inputRecords, allKeysAndLocations,
         mayContainDuplicateLookup, shouldUpdatePartitionPath, config, 
hoodieTable);
   }
 
   private HoodiePairData<String, HoodieRecordGlobalLocation> 
fetchRecordGlobalLocations(
-      HoodieEngineContext context, HoodieTable hoodieTable, int parallelism,
-      List<Pair<String, HoodieBaseFile>> baseFiles) {
-    int fetchParallelism = Math.max(1, Math.min(baseFiles.size(), 
parallelism));
-
-    return context.parallelize(baseFiles, fetchParallelism)
+      HoodieTable hoodieTable, int parallelism,
+      HoodieData<Pair<String, HoodieBaseFile>> baseFiles) {
+    return baseFiles.repartition(Math.max(1, 
Math.min(baseFiles.getNumPartitions(), parallelism)))

Review Comment:
   I guess we may need to do that though to maintain parity. Right now the 
number of incoming partitions for the dataset is equivalent to the number 
partitions in the Hudi table. This code would previously split each file to its 
own partition essentially



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