pan3793 commented on code in PR #7153:
URL: https://github.com/apache/iceberg/pull/7153#discussion_r1144168571


##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/SparkSessionCatalog.java:
##########
@@ -352,4 +355,16 @@ public Catalog icebergCatalog() {
         "Cannot return underlying Iceberg Catalog, wrapped catalog does not 
contain an Iceberg Catalog");
     return ((HasIcebergCatalog) icebergCatalog).icebergCatalog();
   }
+
+  @Override
+  public UnboundFunction loadFunction(Identifier ident) throws 
NoSuchFunctionException {
+    try {
+      return super.loadFunction(ident);
+    } catch (NoSuchFunctionException e) {
+      if (getSessionCatalog() instanceof FunctionCatalog) {

Review Comment:
   Since SPARK-37731(https://github.com/apache/spark/pull/35004, fixed in 
3.3.0), `V2SessionCatalog` extends `FunctionCatalog`
   
   ```patch
   class V2SessionCatalog(catalog: SessionCatalog)
   -  extends TableCatalog with SupportsNamespaces with SQLConfHelper {
   +  extends TableCatalog with FunctionCatalog with SupportsNamespaces with 
SQLConfHelper {
   ```
   
   
https://github.com/apache/spark/pull/35004/files#diff-2d6f351fff8241ff1187b98a62e6c57ef3b55349658a9eb98056a14c51a9dc7cL40-R43



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