RussellSpitzer commented on code in PR #15614:
URL: https://github.com/apache/iceberg/pull/15614#discussion_r3396853747


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java:
##########
@@ -765,13 +782,25 @@ public final void initialize(String name, 
CaseInsensitiveStringMap options) {
             CatalogProperties.CACHE_EXPIRATION_INTERVAL_MS,
             CatalogProperties.CACHE_EXPIRATION_INTERVAL_MS_DEFAULT);
 
+    this.restCatalogPurge =
+        PropertyUtil.propertyAsBoolean(
+            options,
+            SparkCatalogProperties.REST_CATALOG_PURGE,
+            SparkCatalogProperties.REST_CATALOG_PURGE_DEFAULT);
+
     // An expiration interval of 0ms effectively disables caching.
     // Do not wrap with CachingCatalog.
     if (cacheExpirationIntervalMs == 0) {
       this.cacheEnabled = false;
     }
 
     Catalog catalog = buildIcebergCatalog(name, options);
+    this.isRestCatalog = catalog instanceof RESTCatalog;
+
+    Preconditions.checkArgument(
+        !restCatalogPurge || isRestCatalog,
+        "Cannot enable '%s': the configured catalog is not a REST catalog",
+        SparkCatalogProperties.REST_CATALOG_PURGE);

Review Comment:
   ```suggestion
       Preconditions.checkArgument(
           !restCatalogPurge || isRestCatalog,
           "Cannot enable '%s': the configured catalog is not a REST catalog: 
%s",
           SparkCatalogProperties.REST_CATALOG_PURGE,
           catalog.getClass().getName());
   ```



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


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

Reply via email to