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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -2264,17 +2258,20 @@ object QueryCompilationErrors {
   }
 
   def usingUntypedScalaUDFError(): Throwable = {
-    new AnalysisException("You're using untyped Scala UDF, which does not have 
the input type " +
-      "information. Spark may blindly pass null to the Scala closure with 
primitive-type " +
-      "argument, and the closure will see the default value of the Java type 
for the null " +
-      "argument, e.g. `udf((x: Int) => x, IntegerType)`, the result is 0 for 
null input. " +
-      "To get rid of this error, you could:\n" +
-      "1. use typed Scala UDF APIs(without return type parameter), e.g. 
`udf((x: Int) => x)`\n" +
-      "2. use Java UDF APIs, e.g. `udf(new UDF1[String, Integer] { " +
-      "override def call(s: String): Integer = s.length() }, IntegerType)`, " +
-      "if input types are all non primitive\n" +
-      s"3. set ${SQLConf.LEGACY_ALLOW_UNTYPED_SCALA_UDF.key} to true and " +
-      s"use this API with caution")
+    new AnalysisException(
+      errorClass = "INVALID_UDF",
+      messageParameters = Array(
+        "You're using untyped Scala UDF, which does not have the input type " +

Review Comment:
   Yep, please make more specific error classes and pass minimum needed info 
via parameters.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to