danny0405 commented on code in PR #14362:
URL: https://github.com/apache/hudi/pull/14362#discussion_r2563709216


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/compact/plan/generators/BaseHoodieCompactionPlanGenerator.java:
##########
@@ -148,10 +148,12 @@ public HoodieCompactionPlan generateCompactionPlan(String 
compactionInstant) thr
               // for both OCC and NB-CC, this is in-correct.
               .filter(logFile -> 
completionTimeQueryView.isCompletedBefore(compactionInstant, 
logFile.getDeltaCommitTime()))
               .sorted(HoodieLogFile.getLogFileComparator()).collect(toList());
-          if (logFiles.isEmpty()) {
-            // compaction is not needed if there is no log file.
-            return null;
-          }
+          return new FileSlice(s.getFileGroupId(), s.getBaseInstantTime(), 
s.getBaseFile().orElse(null), logFiles);
+        })
+        // only pick file slices with log files to compact
+        .filter(FileSlice::hasLogFiles)
+        .map(s -> {
+          List<HoodieLogFile> logFiles = s.getLogFiles().collect(toList());
           totalLogFiles.add(logFiles.size());
           totalFileSlices.add(1L);

Review Comment:
   do you want to fix this `totalFileSlices`? Then we can just move 151 ~ 154 
after this line.



-- 
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]

Reply via email to