mgaido91 commented on a change in pull request #25261: [SPARK-28521][SQL] Fix
error message for built-in functions
URL: https://github.com/apache/spark/pull/25261#discussion_r308603426
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala
##########
@@ -586,8 +586,9 @@ object FunctionRegistry {
val params = Seq.fill(expressions.size)(classOf[Expression])
val f = constructors.find(_.getParameterTypes.toSeq ==
params).getOrElse {
Review comment:
So, I think the problem here is not that we are not considering the
`DataType` args, but the problem IMHO is that we are not handling the case
`validParametersCount == 0`. I think in that case we should throw something
like: `Invalid arguments for function $name.`. Indeed, in the cast case, I'd
argue that it is not so clear to me whether the arguments are 1 or 2, since it
is not `cast(1, string)` but `cast(1 as string)`... So I don't think that it is
correct to state that the number of arguments for cast is 2.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]