File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -658,16 +658,13 @@ func (sw *SlidingWindow) Trigger() {
658658 }
659659
660660 // Retain data that could be in future windows
661- // For sliding windows, we need to keep data that falls within:
662- // - Current window end + size (for overlapping windows)
663- // - Next window end + size (for future windows)
664- // Actually, we should keep all data that could be in any future window
665- // The latest window that could contain a data point is: next.End + size
666- cutoffTime := next .End .Add (sw .size )
661+ // For sliding windows, we need to keep data that falls within future windows
662+ // Future windows start at next.Start or later (next.Start + k * slide)
663+ // So any data with timestamp < next.Start cannot be in any future window
667664 newData := make ([]types.Row , 0 )
668665 for _ , item := range sw .data {
669- // Keep data that could be in future windows (before cutoffTime )
670- if item .Timestamp .Before (cutoffTime ) {
666+ // Keep data that could be in future windows (>= next.Start )
667+ if ! item .Timestamp .Before (* next . Start ) {
671668 newData = append (newData , item )
672669 }
673670 }
You can’t perform that action at this time.
0 commit comments