beyond1920 commented on code in PR #10980:
URL: https://github.com/apache/hudi/pull/10980#discussion_r1555662848


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -147,6 +149,13 @@ public HoodieMergeHandle(HoodieWriteConfig config, String 
instantTime, HoodieTab
     this.preserveMetadata = true;
     init(fileId, this.partitionPath, dataFileToBeMerged);
     validateAndSetAndKeyGenProps(keyGeneratorOpt, config.populateMetaFields());
+    // if the old schema equals to the new schema, avoid heavy rewriting
+    if (config.populateMetaFields() && useWriterSchemaForCompaction) {
+      LOG.info("Using update instead rewriting during compaction");
+      copyOldFunc = (key, record, schema, prop) -> 
this.updateMetadataToOldRecord(key, record, schema, prop);

Review Comment:
   Not exactly.
   The behavior is consistent with the old behavior.
   <img width="1000" alt="image" 
src="https://github.com/apache/hudi/assets/1525333/2ab0c5e8-d22e-41a2-bb73-e541b64a8083";>
   In the above picture, if `config.populateMetaFields() && 
useWriterSchemaForCompaction` is true, the `oldSchema` equals to `newSchema`.



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