RussellSpitzer commented on code in PR #15614:
URL: https://github.com/apache/iceberg/pull/15614#discussion_r2957045846
##########
core/src/main/java/org/apache/iceberg/CachingCatalog.java:
##########
@@ -60,6 +60,20 @@ public static Catalog wrap(
return new CachingCatalog(catalog, caseSensitive,
expirationIntervalMillis);
}
+ /**
+ * Check if the wrapped catalog is an instance of the given class.
+ *
+ * <p>This method is needed for catalog capability detection when
CachingCatalog wraps other
+ * catalog implementations. For example, Spark uses this to determine if the
underlying catalog is
+ * a REST catalog to enable REST-specific features like server-side purge
delegation.
+ *
+ * @param cls the class to check
+ * @return true if the wrapped catalog is an instance of the given class
+ */
+ public boolean wrapped_is_instance(Class<?> cls) {
Review Comment:
A few issues here,
1. We don't do snake case for java code so this should be something a bit
different name wise
2. We are basically exposing the internal catalog here from what is supposed
to be protecting wrapper so I'm not sure this is the right place to do this.
Since this only matters to Spark Catalog we may as well do this just
immediately after we make the catalog but before we wrap it rather than
introspecting it after the fact.
--
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]