vamsikarnika commented on code in PR #13796:
URL: https://github.com/apache/hudi/pull/13796#discussion_r2314912845


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/index/SparkMetadataTableRecordIndex.java:
##########
@@ -196,9 +198,9 @@ public Iterator<Tuple2<String, HoodieRecordGlobalLocation>> 
call(Iterator<String
       HoodiePairData<String, HoodieRecordGlobalLocation> recordIndexData =
           
hoodieTable.getMetadataTable().readRecordIndexLocationsWithKeys(HoodieListData.eager(keysToLookup));
       try {
-        Map<String, HoodieRecordGlobalLocation> recordIndexInfo = 
HoodieDataUtils.dedupeAndCollectAsMap(recordIndexData);
-        return recordIndexInfo.entrySet().stream()
-            .map(e -> new Tuple2<>(e.getKey(), e.getValue())).iterator();
+        List<Pair<Option<String>, HoodieRecordGlobalLocation>> recordIndexInfo 
= HoodieDataUtils.dedupeAndCollectAsList(recordIndexData);
+        return recordIndexInfo.stream()

Review Comment:
   Eliminates the extra step of converting a list into a temporary map that’s 
only used to build another map



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