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


##########
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:
   but it still uses the latest schema as the write schema, how about the 
schema already evolved?



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