hvanhovell commented on code in PR #40796:
URL: https://github.com/apache/spark/pull/40796#discussion_r1190383894
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -1917,6 +1991,37 @@ class SparkConnectPlanner(val session: SparkSession) {
}
}
+ private def transformTypedReduceExpression(
+ fun: proto.Expression.UnresolvedFunction,
+ dataAttributes: Seq[Attribute]): Expression = {
+ assert(fun.getFunctionName == "reduce")
+ if (fun.getArgumentsCount != 1) {
+ throw InvalidPlanInput("reduce requires single child expression")
+ }
+ val udf = fun.getArgumentsList.asScala.toSeq.head match {
+ case expr
+ if expr.hasCommonInlineUserDefinedFunction
+ && expr.getCommonInlineUserDefinedFunction.hasScalarScalaUdf =>
+ TypedScalaUdf(expr.getCommonInlineUserDefinedFunction)
+ case other =>
+ throw InvalidPlanInput(s"reduce should be a scalar scala udf, but got
$other")
Review Comment:
Does it really have to be a typed scala udf? I mean it just needs to a 2-ary
UDF.
--
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]