zhuanshenbsj1 commented on code in PR #8394:
URL: https://github.com/apache/hudi/pull/8394#discussion_r1168119189


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/compact/HoodieFlinkCompactor.java:
##########
@@ -314,6 +314,9 @@ private void compact() throws Exception {
           .setParallelism(1);
 
       env.execute("flink_hudi_compaction_" + String.join(",", 
compactionInstantTimes));
+      if (conf.getBoolean(FlinkOptions.CLEAN_ASYNC_ENABLED) && 
conf.getBoolean(FlinkOptions.CLEAN_OFFLINE_ENABLE)){
+        writeClient.clean();
+      }

Review Comment:
   CompactionCommitSink#open only do clean when 
OptionsResolver.isInsertOverwrite(conf) is true.
   
    ```
    @Override
     public void open(Configuration parameters) throws Exception {
       super.open(parameters);
       if (conf.getBoolean(FlinkOptions.CLEAN_ASYNC_ENABLED)) {
         this.writeClient = FlinkWriteClients.createWriteClient(conf, 
getRuntimeContext());
         this.executor = 
NonThrownExecutor.builder(LOG).waitForTasksFinish(true).build();
   
         if (OptionsResolver.isInsertOverwrite(conf)) {
           String instantTime = HoodieActiveTimeline.createNewInstantTime();
           LOG.info(String.format("exec sync clean with instant time %s...", 
instantTime));
           executor.execute(() -> writeClient.clean(instantTime), "wait for 
sync cleaning finish");
         }
       }
     }
   ```
   
   I think the real cleaning is actually in CompactionCommitSink#doCommit.



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