-
Notifications
You must be signed in to change notification settings - Fork 613
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
feat(expr, frontend): Impl timestamptz
[+-] variable interval
#7751
Conversation
…into jon/timestamptz-add-interval
Codecov Report
@@ Coverage Diff @@
## main #7751 +/- ##
==========================================
- Coverage 71.62% 71.60% -0.02%
==========================================
Files 1098 1098
Lines 174694 174739 +45
==========================================
Hits 125130 125130
- Misses 49564 49609 +45
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM!
# This should first add the days (naively), then the hours, with timezone in mind. | ||
# Daylight savings falls on 2016-10-30 in London timezone | ||
query T | ||
select '2016-10-29 12:00:00'::timestamptz + interval '24 hours' + interval '1 day'; | ||
---- | ||
2016-10-31 11:00:00+00:00 | ||
|
||
# This should first add the days (naively), then the hours, with timezone in mind. |
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.
Are these 2 test cases supposed to have the same comment?
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.
No, they are different, depending on the order of operation, as the interval '24 hours'
meaning will change at the daylight saving boundary
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.
So one of the comment is wrong and needs a change, right?
Actually I think it is the meaning of 1 day
changed to mean 25 hours
during winter backward adjustment "fall back".
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.
Yes, sry, I've changed it. I'll be even more explicit to be clearer.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Handle the date part as naive datetime, and time part as unix milliseconds. This replicates postgres behaviour. We make use of const eval assumption for performance concern.
Checklist
./risedev check
(or alias,./risedev c
)Refer to a related PR or issue link (optional)
#7334
closes: #5826