danny0405 commented on code in PR #9911: URL: https://github.com/apache/hudi/pull/9911#discussion_r1371363530
########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/compact/strategy/DayBasedCompactionStrategy.java: ########## @@ -63,21 +60,9 @@ public Comparator<String> getComparator() { return comparator; } - @Override - public List<HoodieCompactionOperation> orderAndFilter(HoodieWriteConfig writeConfig, - List<HoodieCompactionOperation> operations, List<HoodieCompactionPlan> pendingCompactionPlans) { - // Iterate through the operations and accept operations as long as we are within the configured target partitions - // limit - return operations.stream() - .collect(Collectors.groupingBy(HoodieCompactionOperation::getPartitionPath)).entrySet().stream() - .sorted(Map.Entry.comparingByKey(comparator)).limit(writeConfig.getTargetPartitionsPerDayBasedCompaction()) - .flatMap(e -> e.getValue().stream()).collect(Collectors.toList()); - } - @Override public List<String> filterPartitionPaths(HoodieWriteConfig writeConfig, List<String> allPartitionPaths) { - return allPartitionPaths.stream().map(partition -> partition.replace("/", "-")) - .sorted(Comparator.reverseOrder()).map(partitionPath -> partitionPath.replace("-", "/")) + return allPartitionPaths.stream().sorted(comparator) .collect(Collectors.toList()).subList(0, Math.min(allPartitionPaths.size(), Review Comment: Okay, got it, caution that you have changed the comparator of the partitions, does that introduce any protential regressions ? Can we add some tests to conver it. -- 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