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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieTableServiceClient.java:
##########
@@ -795,6 +795,11 @@ protected HoodieTable 
createTableAndValidate(HoodieWriteConfig config,
     if (!skipValidation) {
       
CommonClientUtils.validateTableVersion(table.getMetaClient().getTableConfig(), 
config);
     }
+    // Overlay the persisted POPULATE_META_FIELDS and META_FIELDS_EXCLUDE_LIST 
onto the
+    // shared writer config so table services (clustering/compaction/clean) 
see the on-disk
+    // state. Safe to mutate in place: these properties are immutable for the 
lifetime of
+    // the table. Mirrors the same step in 
BaseHoodieWriteClient.createTableAndValidate.
+    table.getMetaClient().getTableConfig().overlayMetaFieldProps(config);

Review Comment:
   do we allow to modify the exclude list in writers or not? if it does, this 
would incur errors.
   
   And from high-level, we better not mix the write options with table options 
for these reasons:
   1. there are many codes in write path that can construct the write config, 
not just here, there is risk for options leak;
   2. even if the write options are overridden here, it can be changed 
somewhere else, there is no strong guarantee for immutability.
   
   if the write path needs these metadata flags, always fetch it though the 
table config. Most of the write path already hold a hoodie table which got a 
table config.



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