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_r309244770
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala
 ##########
 @@ -588,14 +588,19 @@ object FunctionRegistry {
           val validParametersCount = constructors
             .filter(_.getParameterTypes.forall(_ == classOf[Expression]))
             .map(_.getParameterCount).distinct.sorted
-          val expectedNumberOfParameters = if (validParametersCount.length == 
1) {
-            validParametersCount.head.toString
-          } else {
-            validParametersCount.init.mkString("one of ", ", ", " and ") +
-              validParametersCount.last
+          val expectedErrorMsg = validParametersCount.length match {
+            case 0 =>
+              ""
 
 Review comment:
   nit: in case of 0, I'd prefer a more generic `Invalid arguments for function 
$name`, instead of `Invalid number of arguments for function $name`. Because as 
I mentioned earlier, I think it is questionable which is the number of 
arguments in this case...

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

Reply via email to