vamshikrishnakyatham commented on code in PR #13728:
URL: https://github.com/apache/hudi/pull/13728#discussion_r2289701638


##########
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:
   Yes, setting indexMetadataOpt = Option.empty() after writing empty index 
definitions is the correct approach here. we can later scope to read it from 
memory instead of deserialised value but currently for reading it from disk and 
avoiding the storage hit from executor side, this approach would be better.



-- 
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]

Reply via email to