nyingping commented on a change in pull request #35362:
URL: https://github.com/apache/spark/pull/35362#discussion_r795391100
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -3884,14 +3884,12 @@ object TimeWindowing extends Rule[LogicalPlan] {
case _ => Metadata.empty
}
+
def getWindow(i: Int, overlappingWindows: Int, dataType: DataType):
Expression = {
- val division = (PreciseTimestampConversion(
- window.timeColumn, dataType, LongType) - window.startTime) /
window.slideDuration
- val ceil = Ceil(division)
- // if the division is equal to the ceiling, our record is the start
of a window
- val windowId = CaseWhen(Seq((ceil === division, ceil + 1)),
Some(ceil))
- val windowStart = (windowId + i - overlappingWindows) *
- window.slideDuration + window.startTime
+ val timestamp = PreciseTimestampConversion(window.timeColumn,
dataType, LongType)
+ val lastStart = timestamp- (timestamp- window.startTime
Review comment:
ok,thanks!
--
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]