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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/clean/CleanPlanner.java:
##########
@@ -451,8 +451,12 @@ && 
noSubsequentReplaceCommit(earliestInstant.getTimestamp(), partitionPath)) {
    * <p>IMPORTANT: {@code fsView.getAllFileGroups} does not return pending 
file groups for metadata table,
    * file listing must be used instead.
    */
-  private boolean hasPendingFiles(String partitionPath) {
+  private boolean mayHavePendingFiles(String partitionPath) {
     try {
+      // As long as there are pending commits never delete empty partitions, 
because they may write files to any partitions.
+      if 
(!hoodieTable.getMetaClient().getCommitsTimeline().filterInflightsAndRequested().empty())
 {
+        return true;

Review Comment:
   For streaming ingestion, there should always be an pending instant on the 
timeline, and the following up logic may never reach.



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