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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/FileGroupReaderBasedMergeHandle.java:
##########
@@ -198,8 +270,10 @@ public void doMerge() {
           }
           // Writes the record
           try {
-            writeToFile(record.getKey(), record, writeSchemaWithMetaFields,
-                config.getPayloadConfig().getProps(), preserveMetadata);
+            // if the record is not being updated and is not a new insert for 
the file group, we must preserve the existing record metadata.
+            boolean shouldPreserveRecordMetadata = preserveMetadata || 
record.getOperation() == null;

Review Comment:
   The record operation is set in the UpdateProcessor. 
   
   You are right, the case A is the only one where there is no operation set. 
For case B, records being updated implies that it is not the same as the 
previous record so in that case you will want to update the meta-fields. If it 
is not updated, it will not have an update operation associated with it.



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