the-other-tim-brown commented on code in PR #11008: URL: https://github.com/apache/hudi/pull/11008#discussion_r1563428947
########## hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/action/deltacommit/SparkUpsertDeltaCommitPartitioner.java: ########## @@ -89,10 +89,13 @@ protected List<SmallFile> getSmallFiles(String partitionPath) { private List<FileSlice> getSmallFileCandidates(String partitionPath, HoodieInstant latestCommitInstant) { // If we can index log files, we can add more inserts to log files for fileIds NOT including those under // pending compaction + Comparator<FileSlice> comparator = Comparator.<FileSlice, Long>comparing(fileSlice -> getTotalFileSize(fileSlice)) + .thenComparing(FileSlice::getFileId); if (table.getIndex().canIndexLogFiles()) { return table.getSliceView() .getLatestFileSlicesBeforeOrOn(partitionPath, latestCommitInstant.getTimestamp(), false) .filter(this::isSmallFile) + .sorted(comparator) .collect(Collectors.toList()); Review Comment: I think it makes sense to prefer the smallest files first as candidates to minimize IO -- 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