mihailotim-db commented on code in PR #50345: URL: https://github.com/apache/spark/pull/50345#discussion_r2010013971
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala: ########## @@ -345,6 +345,16 @@ trait CheckAnalysis extends LookupCatalog with QueryErrorsBase with PlanToString case operator: LogicalPlan => operator transformExpressionsDown { + case hof: HigherOrderFunction if hof.arguments.exists { + case LambdaFunction(_, _, _) => true Review Comment: The issue is in the following query pattern: `select transform(x -> x + 1, array(1,2,3))`. By reversing the parameter order the user sees the error: `call to dataType on unresolved object`, because the lambda function will not be bound properly. This is because `HigherOrderFunction` expects a lambda in a certain place but we never enforce this check anywhere. We can't really place it in `checkInputDataTypes` because we are not going to hit that codepath before erroring out, so we do it in `CheckAnalysis` instead. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org