You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/01/07 08:13:51 UTC

[GitHub] [iceberg] kbendick commented on a change in pull request #3837: Spark: Fix `Table UUID does not match` problem when enable CachingCatalog

kbendick commented on a change in pull request #3837:
URL: https://github.com/apache/iceberg/pull/3837#discussion_r780091194



##########
File path: spark/v3.0/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java
##########
@@ -272,6 +273,17 @@ public void invalidateTable(Identifier ident) {
       load(ident).first().refresh();
     } catch (org.apache.iceberg.exceptions.NoSuchTableException ignored) {
       // ignore if the table doesn't exist, it is not cached
+    } catch (TableUUIDMismatchException e) {
+      try {
+        if (cacheEnabled && !isPathIdentifier(ident)) {
+          ((CachingCatalog) icebergCatalog).invalidate(buildIdentifier(ident));
+          load(ident);
+        } else {
+          throw e;
+        }
+      } catch (org.apache.iceberg.exceptions.NoSuchTableException ignored) {
+        // ignore if the table doesn't exist, it is not cached
+      }

Review comment:
       Would it possibly be better to use some mechanism other than more exceptions for control flow?




-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org