-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(query): Group By queries with offset that crosses a DST boundary can fail #20230
Conversation
…can fail Customer reported that a GROUP BY query with an offset that caused an interval to cross a daylight savings change inserted an extra output row off by one hour. This fix ensured that the start time for the interval of a GROUP BY operator is correctly set before calculating the time zone offset for that date and time.
@@ -815,6 +815,8 @@ func (opt IteratorOptions) Window(t int64) (start, end int64) { | |||
start = t - dt | |||
} | |||
|
|||
start += int64(opt.Interval.Offset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some tests for this behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do. @gshif developed a truly minimal repro case I can encapsulate in a test.
…can fail Customer reported that a GROUP BY query with an offset that caused an interval to cross a daylight savings change inserted an extra output row off by one hour. This fix ensured that the start time for the interval of a GROUP BY operator is correctly set before calculating the time zone offset for that date and time. Fixes #20238
…influxdb into DSB_influxdb_EAR1855
Add a regression test for #20238 to ensure that GROUP BY queries operate correctly when their Interval.Offset causes them to cross daylight savings time boundaries.
Added a regression test, TestGroupByIterator_DST() in query/iterator_test.go. @jsternberg, take a look at your convenience. |
…can fail (#20230) * fix(query): Group By queries with offset that crosses a DST boundary can fail Customer reported that a GROUP BY query with an offset that caused an interval to cross a daylight savings change inserted an extra output row off by one hour. This fix ensured that the start time for the interval of a GROUP BY operator is correctly set before calculating the time zone offset for that date and time. Add TestGroupByIterator_DST() in query/iterator_test.go for regression testing of this bug. Fixes #20238 (cherry picked from commit df39b1e)
Customer reported that a GROUP BY query with an offset that caused an interval
to cross a daylight savings change inserted an extra output row off by one hour.
This fix ensured that the start time for the interval of a GROUP BY operator is
correctly set before calculating the time zone offset for that date and time.
Fixes #20238