aokolnychyi commented on a change in pull request #1785:
URL: https://github.com/apache/iceberg/pull/1785#discussion_r526421061



##########
File path: core/src/main/java/org/apache/iceberg/CachingCatalog.java
##########
@@ -126,20 +127,36 @@ public Transaction 
newReplaceTableTransaction(TableIdentifier ident, Schema sche
     // when the transaction commits, invalidate the table in the cache if it 
is present.
     return CommitCallbackTransaction.addCallback(
         catalog.newReplaceTableTransaction(ident, schema, spec, location, 
properties, orCreate),
-        () -> tableCache.invalidate(canonicalizeIdentifier(ident)));
+        () -> invalidate(canonicalizeIdentifier(ident)));
   }
 
   @Override
   public boolean dropTable(TableIdentifier ident, boolean purge) {
     boolean dropped = catalog.dropTable(ident, purge);
-    tableCache.invalidate(canonicalizeIdentifier(ident));
+    invalidate(canonicalizeIdentifier(ident));
     return dropped;
   }
 
   @Override
   public void renameTable(TableIdentifier from, TableIdentifier to) {
     catalog.renameTable(from, to);
-    tableCache.invalidate(canonicalizeIdentifier(from));
+    invalidate(canonicalizeIdentifier(from));
   }
 
+  private void invalidate(TableIdentifier ident) {
+    tableCache.invalidate(ident);
+    tableCache.invalidateAll(metadataTableIdentifiers(ident));
+  }
+
+  private Iterable<TableIdentifier> metadataTableIdentifiers(TableIdentifier 
ident) {
+    ImmutableList.Builder<TableIdentifier> builder = ImmutableList.builder();
+
+    for (MetadataTableType type : MetadataTableType.values()) {
+      // metadata table resolution is case insensitive right now
+      builder.add(TableIdentifier.parse(ident + "." + type.name()));
+      builder.add(TableIdentifier.parse(ident + "." + 
type.name().toLowerCase()));

Review comment:
       Need to fix this.




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to