Github user raghavgautam commented on a diff in the pull request:
https://github.com/apache/spark/pull/22414#discussion_r218613023
--- 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 --
In scala, this() call has to be first statement in a constructor, this
limits the extent to which code deduplication can be done. I have made changes
to use a helper function for other instances.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]