yihua commented on code in PR #9593:
URL: https://github.com/apache/hudi/pull/9593#discussion_r1316361410


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -346,7 +346,8 @@ public void write(HoodieRecord<T> oldRecord) {
       // writing the first record. So make a copy of the record to be merged
       HoodieRecord<T> newRecord = keyToNewRecords.get(key).newInstance();
       try {
-        Option<Pair<HoodieRecord, Schema>> mergeResult = 
recordMerger.merge(oldRecord, oldSchema, newRecord, newSchema, props);
+        Option<Pair<HoodieRecord, Schema>> mergeResult = recordMerger.merge(

Review Comment:
   I think @beyond1920 is right.  `keyToNewRecords` may contain record keys for 
inserts (i.e., which do not exist in the base file for small file handling).  
It is handled in `HoodieMergeHandle#writeIncomingRecords`.  The `merge` API 
should be called there.
   
   @linliu-code similarly, could you check the places handling inserts in other 
handles including `HoodieLazyInsertIterable`, `HoodieAppendHandle`, 
`HoodieCreateHandle`, and `HoodieSortedMergeHandle`?



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