[fix](function) Fix window_funnel missing boundary events when window overflows at datetime upper bound - #67823
Open
Mryange wants to merge 1 commit into
Open
[fix](function) Fix window_funnel missing boundary events when window overflows at datetime upper bound#67823Mryange wants to merge 1 commit into
Mryange wants to merge 1 commit into
Conversation
… overflows at datetime upper bound
Issue Number: N/A
Problem Summary: When the timestamp is near the DATETIME upper bound (e.g.
9999-12-31 23:59:58), adding the sliding window seconds in
`date_add_interval<SECOND>` overflows the date range. Both `window_funnel` (V1)
and `window_funnel_v2` ignored the `false` return value of
`date_add_interval`, leaving the window end timestamp unchanged at the starting
point, so the boundary event inside the enlarged window was missed: window=1
returned 2 while window=10 returned 1.
Fix: check the return value of `date_add_interval<SECOND>` in both V1 and V2 and
throw an OUT_OF_BOUND exception with the function name, start timestamp and
window seconds, instead of returning a wrong funnel level.
None
- Test:
- [x] Unit Test
- Behavior changed: Yes. An exception is thrown when the window slides past the
DATETIME upper bound, instead of silently returning a wrong result.
- Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For timestamps near the DATETIME upper bound (e.g.
9999-12-31 23:59:58), adding the sliding window seconds indate_add_interval<SECOND>overflows the date range. Bothwindow_funnelandwindow_funnel_v2ignored thefalsereturn value, leaving the window end timestamp at the starting point, so the boundary event inside the enlarged window was missed:window=1returned 2 whilewindow=10returned 1.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)