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


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java:
##########
@@ -375,6 +383,26 @@ public boolean purgeTable(Identifier ident) {
       String metadataFileLocation =
           ((HasTableOperations) 
table).operations().current().metadataFileLocation();
 
+      boolean isRestCatalog =
+          this.icebergCatalog instanceof RESTCatalog
+              || this.icebergCatalog instanceof RESTSessionCatalog
+              || (this.icebergCatalog instanceof CachingCatalog
+                  && ((CachingCatalog) 
this.icebergCatalog).wrapped_is_instance(RESTCatalog.class));
+
+      if (isRestCatalog && this.restCatalogPurge) {
+        // Delegate purge to REST catalog - allows server-side features like 
UNDROP
+        return dropTableWithPurging(ident);
+      }
+
+      if (isRestCatalog && !this.restCatalogPurge) {
+        // Log deprecation warning for client-side purge with REST catalogs
+        LOG.warn(
+            "Client-side purge for REST catalogs is deprecated and will be 
removed in Apache Iceberg 2.0. "
+                + "Set '{}' to true to delegate purge operations to the REST 
catalog. "
+                + "This enables server-side features like UNDROP and prepares 
for the 2.0 behavior change.",

Review Comment:
   I'd remove a bit of this text.  I'm not sure we are fully agreed on the 
deprecation schedule. In this PR I think it's fine to keep the warning and 
explaining the behavior but let's avoid talking about deprecation just yet. We 
can always mark that on the last release before 2.0 anyway. (Same comment for 
the description in properties)



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