sunchao commented on a change in pull request #32082:
URL: https://github.com/apache/spark/pull/32082#discussion_r620753098



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/higherOrderFunctions.scala
##########
@@ -30,13 +30,14 @@ import org.apache.spark.sql.types.DataType
  * so we need to resolve higher order function when all children are either 
resolved or a lambda
  * function.
  */
-case class ResolveHigherOrderFunctions(catalog: SessionCatalog) extends 
Rule[LogicalPlan] {
+case class ResolveHigherOrderFunctions(catalogManager: CatalogManager)
+  extends Rule[LogicalPlan] with LookupCatalog {
 
   override def apply(plan: LogicalPlan): LogicalPlan = plan.resolveExpressions 
{
-    case u @ UnresolvedFunction(fn, children, false, filter, ignoreNulls)
+    case u @ UnresolvedFunction(AsFunctionIdentifier(ident), children, false, 
filter, ignoreNulls)

Review comment:
       @cloud-fan Thanks. Yes you are right, it will fail in this case. I think 
we can perhaps get rid of `AsFunctionIdentifier` and following similar logic as 
you pointed above:
   ```scala
   case u @ UnresolvedFunction(nameParts, children, false, filter, ignoreNulls)
       if hasLambdaAndResolvedArguments(children) =>
     val CatalogAndIdentifier(catalog, ident) = nameParts
     if (nameParts.length == 1 || CatalogV2Util.isSessionCatalog(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.

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