danny0405 commented on code in PR #13728:
URL: https://github.com/apache/hudi/pull/13728#discussion_r2287685822
##########
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:
Hi, why we do a special handling for empty index definitions, when
`indexMetadataOpt.get().getIndexDefinitions().isEmpty()` is true, it should
have the same functionality as `new HoodieIndexMetadata()` ?
--
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]