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: [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