MaxGekk commented on code in PR #38664:
URL: https://github.com/apache/spark/pull/38664#discussion_r1026264084


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala:
##########
@@ -146,7 +147,10 @@ object FunctionRegistryBase {
             .filter(_.getParameterTypes.forall(_ == classOf[Expression]))
             .map(_.getParameterCount).distinct.sorted
           throw QueryCompilationErrors.invalidFunctionArgumentNumberError(
-            validParametersCount, name, params.length)
+            expressions.map(toPrettySQL(_)).mkString(","),

Review Comment:
   Could you pass `Seq[Expression]` into 
`invalidFunctionArgumentNumberError()`, and form a string inside of the method 
as we do in other places like:
   ```scala
     def moreThanOneGeneratorError(generators: Seq[Expression], clause: 
String): Throwable = {
       new AnalysisException(
         errorClass = "UNSUPPORTED_GENERATOR.MULTI_GENERATOR",
         messageParameters = Map(
           "clause" -> clause,
           "num" -> generators.size.toString,
           "generators" -> generators.map(toSQLExpr).mkString(", ")))
     }
   ```
   
   For instance, if we change the implementation of `toSQLExpr()`, your 
exceptions won't pick up new impl.



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

Reply via email to