You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2023/05/05 03:18:16 UTC

[GitHub] [hudi] danny0405 commented on a diff in pull request #8492: [HUDI-6096] Update table name in hoodie.properties from the write config when it is changed.

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -1193,6 +1194,17 @@ protected final HoodieTable initTable(WriteOperationType operationType, Option<S
       default:
     }
 
+    // Keep hoodie.properties updated from write config
+    HoodieTableConfig tableConfig = metaClient.getTableConfig();
+    if (!StringUtils.isNullOrEmpty(config.getTableName()) && !config.getTableName().equals(tableConfig.getTableName())) {
+      LOG.info("Table name for dataset has changed from " + tableConfig.getTableName() + " to " + config.getTableName());
+      tableConfig.setTableName(config.getTableName());
+      HoodieTableConfig.update(metaClient.getFs(), new Path(metaClient.getMetaPath()), tableConfig.getProps());

Review Comment:
   Yeah, I was just addressing some concerns from the hign level, like the user habits comparing to normal RDBMS, usually people rename the table first though catalog or CLI, then restart the write pipeline.



-- 
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-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org