wzx140 commented on code in PR #6745:
URL: https://github.com/apache/hudi/pull/6745#discussion_r993193990


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroRecordMerger.java:
##########
@@ -67,12 +74,12 @@ private HoodieRecord preCombine(HoodieRecord older, 
HoodieRecord newer) {
   }
 
   private Option<HoodieRecord> combineAndGetUpdateValue(HoodieRecord older, 
HoodieRecord newer, Schema schema, Properties props) throws IOException {
-    Option<HoodieAvroIndexedRecord> previousRecordAvroPayload = 
older.toIndexedRecord(schema, props);
-    if (!previousRecordAvroPayload.isPresent()) {
+    Option<IndexedRecord> previousAvroData = older.toIndexedRecord(schema, 
props).map(HoodieAvroIndexedRecord::getData);
+    if (!previousAvroData.isPresent()) {
       return Option.empty();
     }
 
-    return ((HoodieAvroRecord) 
newer).getData().combineAndGetUpdateValue(previousRecordAvroPayload.get().getData(),
 schema, props)
+    return ((HoodieAvroRecord) 
newer).getData().combineAndGetUpdateValue(previousAvroData.get(), schema, props)
         .map(combinedAvroPayload -> new 
HoodieAvroIndexedRecord((IndexedRecord) combinedAvroPayload));

Review Comment:
   I don't think so. In HoodieAvroRecordMerger, we do 
`combineAndGetUpdateValue` before writing and shuffling is done before 
`combineAndGetUpdateValue`. We do `preCombine` with record which hold avro byte 
and then shuffle the result. So there is no performce loss. This is also the 
original logic.



-- 
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-unsubscr...@hudi.apache.org

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

Reply via email to