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


##########
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:
   So you are assuming the compaction does not involve schema evolution or just 
the latest schema might be okay because the schema is compatible? How can we 
ensure the schema compatibility?



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