grundprinzip commented on code in PR #38270:
URL: https://github.com/apache/spark/pull/38270#discussion_r996427097
##########
connector/connect/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -193,20 +189,10 @@ class SparkConnectPlanner(plan: proto.Relation, session:
SparkSession) {
*/
private def transformScalarFunction(fun:
proto.Expression.UnresolvedFunction): Expression = {
val funName = fun.getPartsList.asScala.mkString(".")
- funName match {
- case "gt" =>
- assert(fun.getArgumentsCount == 2, "`gt` function must have two
arguments.")
- expressions.GreaterThan(
- transformExpression(fun.getArguments(0)),
- transformExpression(fun.getArguments(1)))
- case "eq" =>
- assert(fun.getArgumentsCount == 2, "`eq` function must have two
arguments.")
- expressions.EqualTo(
- transformExpression(fun.getArguments(0)),
- transformExpression(fun.getArguments(1)))
- case _ =>
- lookupFunction(funName,
fun.getArgumentsList.asScala.map(transformExpression).toSeq)
- }
+ UnresolvedFunction(
+ Seq(funName),
Review Comment:
There is another thing that we probably have to do similar to what you've
done for the unresolved identifier, just passing the full string to the backend
and then figure out there when do we split accordingly.
--
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]