You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "nsivabalan (via GitHub)" <gi...@apache.org> on 2023/04/18 02:06:57 UTC

[GitHub] [hudi] nsivabalan commented on a diff in pull request #8410: [HUDI-6050] Fix write helper deduplicate records lost origin data operation

nsivabalan commented on code in PR #8410:
URL: https://github.com/apache/hudi/pull/8410#discussion_r1169415773


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/commit/HoodieWriteHelper.java:
##########
@@ -78,7 +79,8 @@ protected HoodieData<HoodieRecord<T>> doDeduplicateRecords(
         throw new HoodieException(String.format("Error to merge two records, %s, %s", rec1, rec2), e);
       }
       HoodieKey reducedKey = rec1.getData().equals(reducedRecord.getData()) ? rec1.getKey() : rec2.getKey();
-      return reducedRecord.newInstance(reducedKey);
+      HoodieOperation operation = rec1.getData().equals(reducedRecord.getData()) ? rec1.getOperation() : rec2.getOperation();
+      return reducedRecord.newInstance(reducedKey, operation);

Review Comment:
   not sure this statement "the current contract of payload merging is either one of the payload would be returned(no copying, no composition)" is true? 
   for partial update payload scenarios, new payload constructed will include some values from old record and some from new incoming. 
   



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org