Github user maropu commented on a diff in the pull request:
https://github.com/apache/spark/pull/22414#discussion_r217576554
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/TimeWindow.scala
---
@@ -35,29 +35,15 @@ 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")
//////////////////////////
// SQL Constructors
//////////////////////////
- def this(
- timeColumn: Expression,
- windowDuration: Expression,
- slideDuration: Expression,
- startTime: Expression) = {
- this(timeColumn, TimeWindow.parseExpression(windowDuration),
- TimeWindow.parseExpression(slideDuration),
TimeWindow.parseExpression(startTime))
- }
-
- def this(timeColumn: Expression, windowDuration: Expression,
slideDuration: Expression) = {
- this(timeColumn, TimeWindow.parseExpression(windowDuration),
- TimeWindow.parseExpression(slideDuration), 0)
- }
-
- def this(timeColumn: Expression, windowDuration: Expression) = {
- this(timeColumn, windowDuration, windowDuration)
- }
--- End diff --
You cannot remove these constructors.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]