rdblue commented on code in PR #11317: URL: https://github.com/apache/iceberg/pull/11317#discussion_r1881174754
########## spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java: ########## @@ -365,6 +370,14 @@ public boolean purgeTable(Identifier ident) { String metadataFileLocation = ((HasTableOperations) table).operations().current().metadataFileLocation(); + if ((this.icebergCatalog instanceof RESTCatalog + || this.icebergCatalog instanceof RESTSessionCatalog + || (this.icebergCatalog instanceof CachingCatalog + && ((CachingCatalog) this.icebergCatalog).wrapped_is_instance(RESTCatalog.class))) + && this.restCatalogPurge) { Review Comment: I don't understand why this is specific to REST. Shouldn't the flag delegate purge to the catalog implementation, rather than handling it in the `SparkCatalog` wrapper? That's simpler. I suspect that the argument against the simpler option is that we want to eventually make this the default behavior, in which case we would not get parallelized purge behavior. But in that case, I'd rather have some way to parallelize catalog operations than have hacky checks that break the layers of abstraction. The Spark catalog could instead pass a function that accepts a FileIO and metadata location and purges it when it creates the wrapped catalog. -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org