Rajeev-01 commented on code in PR #18054:
URL: https://github.com/apache/hudi/pull/18054#discussion_r2749721305
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -949,8 +949,16 @@ private HoodieTableMetaClient initializeMetaClient()
throws IOException {
.setBaseFileFormat(HoodieFileFormat.HFILE.toString())
.setRecordKeyFields(RECORD_KEY_FIELD_NAME)
.setPopulateMetaFields(DEFAULT_METADATA_POPULATE_META_FIELDS)
-
.setKeyGeneratorClassProp(HoodieTableMetadataKeyGenerator.class.getCanonicalName())
- .initTable(storageConf.newInstance(),
metadataWriteConfig.getBasePath());
+
.setKeyGeneratorClassProp(HoodieTableMetadataKeyGenerator.class.getCanonicalName());
+
+ // Get the database name from dataTable config
+ String databaseName = dataMetaClient.getTableConfig().getDatabaseName();
+
+ if (!StringUtils.isNullOrEmpty(databaseName)) {
+ builder.setDatabaseName(databaseName);
+ }
Review Comment:
Every data table needs to get to know database name and table name and let
say if the data table previously only has `hoodie.table.name` which is of
format `db.table` then metadata table should also have created with db.table
format which is good. Let say if the data table properties has been updated but
the metadata table still points to the older one which is fine since it has
db.table format.
But the only miss will be the direct property updates which can't gets
propagate to the metadata table. But I guess we can do it by adding only
specific whitelist config updates needs to propagate to metadata table. WDYT? 😅
--
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]