codope commented on a change in pull request #5186:
URL: https://github.com/apache/hudi/pull/5186#discussion_r841047175
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTable.java
##########
@@ -802,6 +805,48 @@ public HoodieEngineContext getContext() {
return Option.empty();
}
+ /**
+ * Deletes the metadata table if the writer disables metadata table with
hoodie.metadata.enable=false
+ */
+ public void maybeDeleteMetadataTable() {
+ if (shouldExecuteMetadataTableDeletion()) {
+ try {
+ Path mdtBasePath = new
Path(HoodieTableMetadata.getMetadataTableBasePath(config.getBasePath()));
+ FileSystem fileSystem = metaClient.getFs();
+ if (fileSystem.exists(mdtBasePath)) {
+ LOG.info("Deleting metadata table because it is disabled in
writer.");
+ fileSystem.delete(mdtBasePath, true);
+ }
Review comment:
Can we reuse `HoodieTableMetadataUtil#deleteMetadataTable` or refactor
existing/add another method in util?
--
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]