You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/14 18:19:46 UTC

[GitHub] [spark] srielau commented on a change in pull request #35638: [SPARK-38296][SQL] Support error class AnalysisExceptions in FunctionRegistry

srielau commented on a change in pull request #35638:
URL: https://github.com/apache/spark/pull/35638#discussion_r826253174



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1525,8 +1525,13 @@ object QueryCompilationErrors {
   }
 
   def invalidLiteralForWindowDurationError(): Throwable = {
-    new AnalysisException("The duration and time inputs to window must be " +
-      "an integer, long or string literal.")
+    new AnalysisException(
+      errorClass = "INVALID_PARAMETER_VALUE",
+      messageParameters = Array(
+        "Duration/Time",
+        "window function",
+        "The duration and time " +
+          "inputs to window must be an integer, long or string literal."))

Review comment:
       One key benefit of error classes is that we can move to localized (translated) error messages. So we should avoid "text" in the token - which won't be translated.
   Maybe this text is a hint that this message needs its own error class?




-- 
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-unsubscribe@spark.apache.org

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



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