Skip to content

Commit

Permalink
[MINOR] Fix Out of Bounds Exception for DayBasedCompactionStrategy (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
vamshigv authored and Alexey Kudinkin committed Dec 14, 2022
1 parent 2f28fb2 commit c423e20
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public List<HoodieCompactionOperation> orderAndFilter(HoodieWriteConfig writeCon
public List<String> filterPartitionPaths(HoodieWriteConfig writeConfig, List<String> allPartitionPaths) {
return allPartitionPaths.stream().map(partition -> partition.replace("/", "-"))
.sorted(Comparator.reverseOrder()).map(partitionPath -> partitionPath.replace("-", "/"))
.collect(Collectors.toList()).subList(0, writeConfig.getTargetPartitionsPerDayBasedCompaction());
.collect(Collectors.toList()).subList(0, Math.min(allPartitionPaths.size(),
writeConfig.getTargetPartitionsPerDayBasedCompaction()));
}

/**
Expand Down

0 comments on commit c423e20

Please sign in to comment.