WweiL commented on code in PR #39843:
URL: https://github.com/apache/spark/pull/39843#discussion_r1096389516
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveTimeWindows.scala:
##########
@@ -49,11 +49,23 @@ object TimeWindowing extends Rule[LogicalPlan] {
* The windows are calculated as below:
* maxNumOverlapping <- ceil(windowDuration / slideDuration)
* for (i <- 0 until maxNumOverlapping)
- * lastStart <- timestamp - (timestamp - startTime + slideDuration) %
slideDuration
- * windowStart <- lastStart - i * slideDuration
+ * lastStart <- timestamp - (timestamp - startTime) % slideDuration
+ * lastStartAdjusted <- (timestamp < startTime) ? lastStart -
slideDuration : lastStart
+ * windowStart <- lastStartAdjusted - i * slideDuration
* windowEnd <- windowStart + windowDuration
* return windowStart, windowEnd
*
+ * Rationale of lastStartAdjusted:
Review Comment:
I put it in the description of this PR
--
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]