Skip to content
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 Timestamp +/- Interval #3103

Closed
Tracked by #3148
JasonLi-cn opened this issue Aug 11, 2022 · 5 comments · Fixed by #3110
Closed
Tracked by #3148

feat: support Timestamp +/- Interval #3103

JasonLi-cn opened this issue Aug 11, 2022 · 5 comments · Fixed by #3110
Labels
enhancement New feature or request

Comments

@JasonLi-cn
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
(This section helps Arrow developers understand the context and why for this feature, in addition to the what)

support SQL like:

select now() - interval '1' day from table limit 10;

Describe the solution you'd like
A clear and concise description of what you want to happen.
Support Timestamp +/- in DateIntervalExpr
https://github.com/apache/arrow-datafusion/blob/9956f80f197550051db7debae15d5c706afc22a3/datafusion/expr/src/binary_rule.rs#L96-L104

https://github.com/apache/arrow-datafusion/blob/9956f80f197550051db7debae15d5c706afc22a3/datafusion/physical-expr/src/expressions/datetime.rs#L33-L37

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@JasonLi-cn JasonLi-cn added the enhancement New feature or request label Aug 11, 2022
@turbo1912
Copy link
Contributor

I believe these two issues are describing the same problem;

#3093

@waitingkuo
Copy link
Contributor

@turbo1912 this issue is to request timestamp +/- interval
#3093 is to report bug for date +/- interval

@waitingkuo
Copy link
Contributor

@turbo1912 the original issue in #3093 is solved. These 2 issues are the same now. I closed #3093 , thank you

@JasonLi-cn
Copy link
Contributor Author

@turbo1912 the original issue in #3093 is solved. These 2 issues are the same now. I closed #3093 , thank you
It's my pleasure. In PR: #3110 (comment)

select now()::date, now()::date + interval '1 hour'
+-----------------------+----------------------------------------------------+
| CAST(now() AS Date32) | CAST(now() AS Date32) + IntervalDayTime("3600000") |
+-----------------------+----------------------------------------------------+
| 2022-08-12            | 2022-08-12                                         |
+-----------------------+----------------------------------------------------+
select now(), now() + interval '1 hour'
+----------------------------+------------------------------------+
| now()                      | now() + IntervalDayTime("3600000") |
+----------------------------+------------------------------------+
| 2022-08-12 03:31:45.459837 | 2022-08-12 04:31:45.459837         |
+----------------------------+------------------------------------+

I don't know if this implementation will meet your expectations

@alamb
Copy link
Contributor

alamb commented Aug 12, 2022

FYI @waitingkuo. Perhaps we should add this ticket to the timestamp epic: #3100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants