Github user raghavgautam commented on a diff in the pull request: https://github.com/apache/spark/pull/22414#discussion_r218153205 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/TimeWindow.scala --- @@ -35,6 +35,10 @@ case class TimeWindow( with ImplicitCastInputTypes with Unevaluable with NonSQLExpression { + require(windowDuration > 0, "The window duration must be " + + s"a positive integer, long or string literal, found: $windowDuration") + require(slideDuration > 0, "The slide duration must be " + + s"a positive integer, long or string literal, found: $slideDuration") --- End diff -- The constructor has no information about the unit of the duration e.g. -1 day would get converted to -86,400,000,000 in the error message, which is confusing.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org