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/10/26 08:28:52 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #38394: [WIP][SPARK-40759][SQL] Migrate type check failures of time window onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -270,6 +270,11 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_PARAMETER_CONSTRAINT" : {

Review Comment:
   How about `PARAMETER_CONSTRAINT_VIOLATION`



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/TimeWindow.scala:
##########
@@ -114,18 +115,48 @@ case class TimeWindow(
     val dataTypeCheck = super.checkInputDataTypes()
     if (dataTypeCheck.isSuccess) {
       if (windowDuration <= 0) {
-        return TypeCheckFailure(s"The window duration ($windowDuration) must be greater than 0.")
+        return DataTypeMismatch(
+          errorSubClass = "VALUE_OUT_OF_RANGE",
+          messageParameters = Map(
+            "exprName" -> "window_duration",

Review Comment:
   Please, use `toSQLId()` here and below.



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