yihua commented on code in PR #9337: URL: https://github.com/apache/hudi/pull/9337#discussion_r1283389955
########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bloom/HoodieBloomIndex.java: ########## @@ -214,12 +214,16 @@ protected List<Pair<String, BloomIndexFileInfo>> loadColumnRangesFromMetaIndex( String keyField = hoodieTable.getMetaClient().getTableConfig().getRecordKeyFieldProp(); + List<Pair<String, HoodieBaseFile>> baseFilesForAllPartitions = HoodieIndexUtils.getLatestBaseFilesForAllPartitions(partitions, context, hoodieTable); + List<Pair<String, String>> partitionFileNameList = new ArrayList<>(baseFilesForAllPartitions.size()); + Map<Pair<String, String>, String> partitionAndFileNameToFileId = new HashMap<>(baseFilesForAllPartitions.size()); + baseFilesForAllPartitions.forEach(pair -> { + Pair<String, String> parititonAndFileName = Pair.of(pair.getKey(), pair.getValue().getFileName()); + partitionFileNameList.add(parititonAndFileName); + partitionAndFileNameToFileId.put(parititonAndFileName, pair.getValue().getFileId()); + }); // Partition and file name pairs - List<Pair<String, String>> partitionFileNameList = - HoodieIndexUtils.getLatestBaseFilesForAllPartitions(partitions, context, hoodieTable).stream() - .map(partitionBaseFilePair -> Pair.of(partitionBaseFilePair.getLeft(), partitionBaseFilePair.getRight().getFileName())) - .sorted() - .collect(toList()); + Collections.sort(partitionFileNameList); // TODO why does this need to be sorted? Review Comment: Yes, looks like this sorting is not needed anymore. Likely leftover from the previous refactoring. The keys to look up in MDT needs to be sorted after generation. The list of partition and file name pairs need not tobe sorted here. -- 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: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org