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


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroRecordMerger.java:
##########
@@ -71,10 +71,11 @@ public <T> BufferedRecord<T> merge(BufferedRecord<T> older, 
BufferedRecord<T> ne
         if (updatedRecord == previousAvroData || updatedRecord == 
HoodieRecord.SENTINEL) {
           return older;
         }
-        if (updatedRecord == newerAvroRecord) {
-          // simply return the newer record instead of creating a new record
-          return newer;
-        }
+        // Do not short-circuit to `newer` when updatedRecord == 
newerAvroRecord. Some payloads
+        // (e.g. PostgresDebeziumAvroPayload's TOAST backfill via 
mergeToastedValuesIfPresent)

Review Comment:
   can we fix the payload instead of the merger, either:
   
   - alwasy make the payload immutable and create new one when backfill 
modifications are needed;
   - impl `#equals` for all kinds of payloads to more detailed equation check.
   
   so that we avoid perf regression for existing payloads.



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