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/08 12:02:59 UTC

[GitHub] [iceberg] smallx commented on a change in pull request #3861: Spark: Reduce unnecessary remote service requests in `SparkSessionCatalog.invalidateTable`

smallx commented on a change in pull request #3861:
URL: https://github.com/apache/iceberg/pull/3861#discussion_r780662573



##########
File path: spark/v3.0/spark/src/main/java/org/apache/iceberg/spark/SparkSessionCatalog.java
##########
@@ -123,11 +123,10 @@ public Table loadTable(Identifier ident) throws NoSuchTableException {
 
   @Override
   public void invalidateTable(Identifier ident) {
-    if (icebergCatalog.tableExists(ident)) {
-      icebergCatalog.invalidateTable(ident);
-    } else {
-      getSessionCatalog().invalidateTable(ident);
-    }
+    // We do not need to check whether the table exists and whether
+    // it is an Iceberg table to reduce remote service requests.
+    icebergCatalog.invalidateTable(ident);

Review comment:
       @RussellSpitzer Sorry, I forgot link to https://github.com/apache/iceberg/pull/3837. In https://github.com/apache/iceberg/pull/3837, we add a `invalidateTable` method to `Catalog` interface and remove `load` calls in `SparkCatalog.invalidateTable`.




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