HeartSaVioR commented on a change in pull request #35680:
URL: https://github.com/apache/spark/pull/35680#discussion_r833192788
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -4061,10 +4061,30 @@ object SessionWindowing extends Rule[LogicalPlan] {
case s: SessionWindow => sessionAttr
}
+ def isGapInvalid(child: Expression): Boolean = {
+ val calendarInterval = IntervalUtils
+ .safeStringToInterval(UTF8String.fromString(child.toString))
+ calendarInterval == null ||
+ calendarInterval.months + calendarInterval.days +
calendarInterval.microseconds <= 0
+ }
+
+ val filterTimeSize = gapDuration match {
Review comment:
Which cases this targets to? I only see the case of StringType (meaning
static gap) which is going to be casted as CalendarIntervalType, but please
correct me if I'm missing something.
Please make sure the code tightly picks up with the cases. For me, current
pattern matching does not seem to be intuitive to understand. If you feel this
code does not seem to be intuitive due to the fact you are disassembling Cast
here, you can just deal with `session.gapDuration` instead, which is not yet
wrapped.
--
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]