-
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: interval add timestamp #5491
Conversation
c2ac111
to
8e65992
Compare
Thank you for the contribution @Weijun-H! Could you please add some "end-to-end" sqllogictests (I guess adding to timestamps.slt or maybe scalar.slt will be fine)? It'll also allow to check if additional changes in type coercion rules / transforming SQL to physical expressions are needed. |
@@ -191,3 +191,24 @@ query P | |||
SELECT DATE_TRUNC('second', '2022-08-03 14:38:50Z'); | |||
---- | |||
2022-08-03T14:38:50 | |||
|
|||
# Test that interval can add a timestamp |
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.
Thank you!
I also suppose it's worth adding tests for interval + timestamp
case, as it was added in scalar.rs
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.
I see tests here for timestamp + interval
and interval + timestamp
(e.g. SELECT INTERVAL '8' DAY + timestamp '2013-07-01 12:00:00';
)
I don't see tests for date + timestamp
and timestamp + date
-- maybe that is what you meant?
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.
I meant last four tests, added in 2nd commit. Now when we have them this conversation can be "marked as resolved" 🙃
4b3b94a
to
fbe6c7c
Compare
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.
@@ -197,6 +197,16 @@ pub fn create_physical_expr( | |||
rhs, | |||
input_schema, | |||
)?)), | |||
( | |||
DataType::Interval(_), |
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.
👍
@@ -191,3 +191,24 @@ query P | |||
SELECT DATE_TRUNC('second', '2022-08-03 14:38:50Z'); | |||
---- | |||
2022-08-03T14:38:50 | |||
|
|||
# Test that interval can add a timestamp |
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.
I see tests here for timestamp + interval
and interval + timestamp
(e.g. SELECT INTERVAL '8' DAY + timestamp '2013-07-01 12:00:00';
)
I don't see tests for date + timestamp
and timestamp + date
-- maybe that is what you meant?
Hi @alamb, I have not tested |
LGTM Thanks again @Weijun-H! |
No sorry for not being clear. I was confused about @korowa 's suggestion. No changes needed. Thank you! |
Benchmark runs are scheduled for baseline = 9e32de3 and contender = 89ca583. 89ca583 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?
Closes #5413
Rationale for this change
As the
timestamp
+ feature has already been implemented, you can further enhance theimp_op
function by adding additional matching conditions to supportinterval
operations.What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?