danny0405 commented on code in PR #13728:
URL: https://github.com/apache/hudi/pull/13728#discussion_r2289677958
##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java:
##########
@@ -271,7 +271,13 @@ public boolean buildIndexDefinition(HoodieIndexDefinition
indexDefinition) {
public void deleteIndexDefinition(String indexName) {
checkState(indexMetadataOpt.isPresent(), "Index metadata is not present");
indexMetadataOpt.get().getIndexDefinitions().remove(indexName);
- writeIndexMetadataToStorage();
+ if (indexMetadataOpt.get().getIndexDefinitions().isEmpty()) {
+ String indexMetaPath = getIndexDefinitionPath();
+ writeIndexMetadataToStorage(storage, indexMetaPath, new
HoodieIndexMetadata(), getTableConfig().getTableVersion());
Review Comment:
> for empty index definitions because writeIndexMetadataToStorage() method
just flushes to disk for non empty indexMetadataOpt and to handle the empty
flush to disk, i am using it
the `indexMetadataOpt` is set up as `Option.empty` after the write, so we
are good to go?
--
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]