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


##########
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:
   @wzx140 we should actually produce `HoodieAvroRecord` here instead:
   
    - Merged records will be subsequently reshuffled a few times, and shuffling 
`IndexedRecord` will kill performance
    - Instead we should use `HoodieAvroRecord` holding some dummy 
`RecordPayload` just holds Avro bytes for us (and throws if anyone will try to 
use it for merging) 
   
   Does it make sense?



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