the-other-tim-brown commented on code in PR #13726:
URL: https://github.com/apache/hudi/pull/13726#discussion_r2283717477


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -477,21 +477,26 @@ private static <R> Option<HoodieRecord<R>> 
mergeIncomingWithExistingRecord(
           writeSchemaWithMetaFields, config, recordMerger, keyGenerator, 
incomingRecordContext, existingRecordContext, orderingFieldNames);
     } else {
       // prepend the hoodie meta fields as the incoming record does not have 
them
-      HoodieRecord incomingPrepended = incoming
-          .prependMetaFields(writeSchema, writeSchemaWithMetaFields, new 
MetadataValues().setRecordKey(incoming.getRecordKey()).setPartitionPath(incoming.getPartitionPath()),
 config.getProps());
-      BufferedRecord<R> incomingBufferedRecord = 
BufferedRecords.fromHoodieRecord(incomingPrepended, writeSchemaWithMetaFields, 
incomingRecordContext, config.getProps(), orderingFieldNames);
+      BufferedRecord<R> incomingBufferedRecord = 
BufferedRecords.fromHoodieRecord(incoming, writeSchemaWithMetaFields, 
incomingRecordContext, config.getProps(), orderingFieldNames);
       BufferedRecord<R> existingBufferedRecord = 
BufferedRecords.fromHoodieRecord(existing, writeSchemaWithMetaFields, 
existingRecordContext, config.getProps(), orderingFieldNames);
+      
existingBufferedRecord.project(existingRecordContext.projectRecord(writeSchemaWithMetaFields,
 writeSchema));

Review Comment:
   We would need to output a serializable function instead of UnaryOperator 
which would require larger changes. For spark, the function gets cached. For 
Avro, this just calls a static method so there is not much savings here.



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