zhengruifeng commented on code in PR #39068:
URL: https://github.com/apache/spark/pull/39068#discussion_r1051735957


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -565,6 +565,47 @@ class SparkConnectPlanner(session: SparkSession) {
         val children = 
fun.getArgumentsList.asScala.toSeq.map(transformExpression)
         Some(In(children.head, children.tail))
 
+      case "___lambda_function___" =>
+        // UnresolvedFunction[___lambda_function___, ["x, y -> x < y", "x", 
"y"]]
+
+        if (fun.getArgumentsCount < 2) {
+          throw InvalidPlanInput(
+            "LambdaFunction requires at least 2 child expressions: 
LamdaFunction, Arguments")
+        }
+
+        val children = 
fun.getArgumentsList.asScala.toSeq.map(transformExpression)
+
+        val function = children.head
+
+        val variableNames = children.tail.map {
+          case variable: UnresolvedAttribute if variable.nameParts.length == 1 
=>
+            variable.nameParts.head
+          case other =>
+            throw InvalidPlanInput(
+              "LambdaFunction requires all arguments to be UnresolvedAttribute 
with " +
+                s"single name part, but got $other")

Review Comment:
   1, the error message also mentioned `UnresolvedAttribute`
   
   2, existing implementation in PySpark only use single part name



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