danny0405 commented on code in PR #17943:
URL: https://github.com/apache/hudi/pull/17943#discussion_r2791464965
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/clean/CleanPlanner.java:
##########
@@ -184,14 +184,15 @@ private boolean canCleanBeSkipped() {
}
// Check whether there are any other commits apart from deltacommits
between last compaction and last clean.
- int nonDeltaCommitsBetweenCompactionAndClean = activeTimeline
- .findInstantsAfter(lastCompactionInstant.get().requestedTime())
- .findInstantsBefore(lastCleanInstant.get().requestedTime())
+ int numNonDeltaCommitsAfterLastClean = activeTimeline
+ .getWriteTimeline()
+ .filterCompletedInstants()
+ .findInstantsAfter(lastCleanInstant.get().requestedTime())
.filter(instant ->
!instant.getAction().equals(HoodieTimeline.DELTA_COMMIT_ACTION))
.countInstants();
return
InstantComparison.compareTimestamps(lastCompactionInstant.get().getCompletionTime(),
Review Comment:
it looks like the comparison at line L194 is redundant now because of the
L191 filtering:
```java
InstantComparison.compareTimestamps(lastCompactionInstant.get().getCompletionTime(),
InstantComparison.LESSER_THAN,
lastCleanInstant.get().requestedTime())
```
just `numNonDeltaInstantsAfterCleanRequestedTime == 0` should be good.
--
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]