-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Support week
, decade
, century
for Interval literal
#3038
Conversation
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.
Thanks @ovr!
d6ee889
to
81f4480
Compare
week
, decade
, century
for Interval literal
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.
Thanks @ovr
"year" => Ok(align_interval_parts(interval_period * 12_f32, 0.0, 0.0)), | ||
"month" => Ok(align_interval_parts(interval_period, 0.0, 0.0)), | ||
"century" | "centuries" => { | ||
Ok(align_interval_parts(interval_period * 1200_f32, 0.0, 0.0)) |
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.
It might be nice in the future to name constants like 1200_f32
with some symbolic names
like
let YEARS_PER_CENTRY: f32 = 1200_f32;
But that is just a stylistic thing -- it isn't like the number of years in a century is going to be changed at any point in our lifetimes 🤣
Benchmark runs are scheduled for baseline = 07b7314 and contender = 581934d. 581934d is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
A lot of BIs uses
<date expr> + INTERVAL '1 week'
. This PR introduces support for parsing new types for intervals:week
,decades
andcentury
. (last two were added to be similar with Postgres behaviour)Are there any user-facing changes?
New functionality without breaking changes.