prashantwason commented on code in PR #18181:
URL: https://github.com/apache/hudi/pull/18181#discussion_r2910857538
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/HoodieSparkTable.java:
##########
@@ -101,7 +97,7 @@ protected Option<HoodieTableMetadataWriter>
getMetadataWriter(
if (isMetadataTable()) {
return Option.empty();
}
- if (config.isMetadataTableEnabled()) {
+ if (getMetaClient().getTableConfig().isMetadataTableAvailable() ||
config.isMetadataTableEnabled()) {
Review Comment:
Good point. The intent is specifically to keep the writer alive when
`auto-delete` is disabled. When `isMetadataTableAvailable()` is true (MDT
exists on disk per table config) but `isMetadataTableEnabled()` is false in
write config, we now create the writer so that the MDT stays in sync. The
`isAutoDeleteMdtPartitionsEnabled` guard in `maybeDeleteMetadataTable()`
ensures we don't accidentally delete the MDT when a misconfigured writer
disables metadata.
Added a clarifying comment in the latest commit explaining this intent.
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTable.java:
##########
@@ -1121,6 +1121,9 @@ protected Option<HoodieTableMetadataWriter>
getMetadataWriter(
* Deletes the metadata table if the writer disables metadata table with
hoodie.metadata.enable=false
*/
public void maybeDeleteMetadataTable() {
Review Comment:
Updated the Javadoc to mention the `auto.delete.partitions` config in the
latest commit.
--
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]