-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Removal of arithmetic operations for temporal values to binary.rs #5846
Removal of arithmetic operations for temporal values to binary.rs #5846
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.
Thank you @berkaysynnada
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.
What I am hoping we can do is to move the temporal logic into kernels such as
pub fn add_dyn(lhs: ArrayRef, rhs: ArrayRef) -> Result<ArrayRef> {
match(lhs.data_type(), rhs.data_type()) {
(DataType::Timestamp, DataType::Interval) => {
// call timestamp + interval code
},
// handle other temporal types
_ => {
// fall back to kernels in arrow-rs
arrow::compute::add_dyn(...)
}
}
With this pattern, once the arrow kernel supports interval arithmetic, we can remove the shim datafusion.
We followed this pattern initially when implementing much of the decimal arithmetic, and it worked well I think
Is this something you can help with @berkaysynnada ?
I have other commitments currently. I would be happy to help when I have more time, but anyone interested in this issue can contact me when needed. |
@alamb would you mind taking a look at this PR when you have time? I tried to implement the changes you suggested. Since the only evaluation of array vs array operations are merged yet (array vs scalar implementation PR will be opened soon), I worked on them. The same approach can be applied to array vs scalar part after it is merged. Thanks for your feedback |
I plan to review this PR today |
Which issue does this PR close?
Closes #5704.
#5764 (comment)
#5764 (comment)
Rationale for this change
Before moving the temporal arithmetic to arrow-rs, it is more convenient to deploy them in binary.rs.
What changes are included in this PR?
the macros and arithmetic functions in datetime.rs are moved to binary.rs.
Are these changes tested?
yes, with existing tests.
Are there any user-facing changes?