grundprinzip commented on code in PR #39068:
URL: https://github.com/apache/spark/pull/39068#discussion_r1051953537
##########
connector/connect/common/src/main/protobuf/spark/connect/expressions.proto:
##########
@@ -167,4 +169,26 @@ message Expression {
// (Optional) Alias metadata expressed as a JSON map.
optional string metadata = 3;
}
+
+ message LambdaFunction {
+ // (Required) The lambda function.
+ Expression function = 1;
+
+ // (Required) Function arguments. Must not be empty.
+ //
+ // All arguments must be UnresolvedNamedLambdaVariables.
+ repeated Expression arguments = 2;
Review Comment:
In general I'm in favor of `repeated string` since it's clearer about the
intention. I think this function is a good example where we need to put
guidance on where the correct resolution of function arguments happens.
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -534,6 +536,36 @@ class SparkConnectPlanner(session: SparkSession) {
}
}
+ /**
+ * Translates a LambdaFunction from proto to the Catalyst expression.
+ */
+ private def transformLamdaFunction(lambda: proto.Expression.LambdaFunction):
Expression = {
+ if (lambda.getArgumentsCount == 0) {
Review Comment:
Do we get an analysis exception if more than three arguments are submitted?
--
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]