nsivabalan commented on code in PR #5296:
URL: https://github.com/apache/hudi/pull/5296#discussion_r848452061


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -354,12 +349,7 @@ public void write(GenericRecord oldRecord) {
     if (copyOldRecord) {
       // this should work as it is, since this is an existing record
       try {
-        // rewrite file names
-        // do not preserve FILENAME_METADATA_FIELD
-        if (preserveMetadata && useWriterSchemaForCompaction) {
-          oldRecord.put(HoodieRecord.FILENAME_METADATA_FIELD_POS, 
newFilePath.getName());
-        }
-        fileWriter.writeAvro(key, oldRecord);

Review Comment:
   in this flow, do we need to do both?
   - rewriteRecord(avroRecord)
   - writeAvroWithMetadata
   
   I guess, only 2nd one would suffice. L 369. 
   I understand for L296, we need both, but here we don't need to rewrite 
record for the case when preserveMetadata is false.
   



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