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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandleWithChangeLog.java:
##########
@@ -89,9 +94,19 @@ protected void writeInsertRecord(HoodieRecord<T> 
hoodieRecord, Option<IndexedRec
   public List<WriteStatus> close() {
     List<WriteStatus> writeStatuses = super.close();
     // if there are cdc data written, set the CDC-related information.
-    Option<AppendResult> cdcResult =
-        HoodieCDCLogger.writeCDCDataIfNeeded(cdcLogger, recordsWritten, 
insertRecordsWritten);
-    HoodieCDCLogger.setCDCStatIfNeeded(writeStatuses.get(0).getStat(), 
cdcResult, partitionPath, fs);
+
+    if (cdcLogger == null || recordsWritten == 0L || (recordsWritten == 
insertRecordsWritten)) {
+      // the following cases where we do not need to write out the cdc file:

Review Comment:
   The if condition is not suitable for Flink, we may need some change for 
flink cdc handles.



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