nsivabalan commented on a change in pull request #5088:
URL: https://github.com/apache/hudi/pull/5088#discussion_r833740121



##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java
##########
@@ -294,13 +292,11 @@ protected boolean writeRecord(HoodieRecord<T> 
hoodieRecord, Option<IndexedRecord
     try {
       if (indexedRecord.isPresent() && !isDelete) {
         // Convert GenericRecord to GenericRecord with hoodie commit metadata 
in schema
-        IndexedRecord recordWithMetadataInSchema = 
rewriteRecord((GenericRecord) indexedRecord.get(), preserveMetadata, oldRecord);
-        if (preserveMetadata && useWriterSchema) { // useWriteSchema will be 
true only incase of compaction.
-          // do not preserve FILENAME_METADATA_FIELD
-          recordWithMetadataInSchema.put(FILENAME_METADATA_FIELD_POS, 
newFilePath.getName());
-          fileWriter.writeAvro(hoodieRecord.getRecordKey(), 
recordWithMetadataInSchema);
+        if (preserveMetadata && useWriterSchema) { // useWriteSchema will be 
true only in case of compaction.

Review comment:
       reason why I had to rewriteRecord is that, indexexRecord did not have 
meta fields with update path from the caller. Hence passed in the oldRecord 
from which we can deduce the meta fields. 
   
   For eg, 
   
   the return value from combineAndGetUpdate(...) does have the meta fields. 
   
   not sure if we can remove 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