prashantwason commented on code in PR #8492:
URL: https://github.com/apache/hudi/pull/8492#discussion_r1172160996
##########
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:
In that case, there is not much use of table name in the HoodieWriteConfig.
1. If any code path depends on table name from HoodieWriteConfig then that
would be using the wrong table name (different from hoodie.properties)
2. If no code path is using table name from HoodieWriteConfig then we may
remove it
3. The writers seems to be using the table name from HoodieWriteConfig and
readers from hoodie.properties. There is a disconnect here.
--
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]