You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "berkaysynnada (via GitHub)" <gi...@apache.org> on 2023/04/03 14:25:07 UTC

[GitHub] [arrow-datafusion] berkaysynnada opened a new pull request, #5846: removal of arithmetic operations for temporal values to binary.rs

berkaysynnada opened a new pull request, #5846:
URL: https://github.com/apache/arrow-datafusion/pull/5846

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #5704.
   
   https://github.com/apache/arrow-datafusion/pull/5764#discussion_r1152348485
   https://github.com/apache/arrow-datafusion/pull/5764#issuecomment-1491998637
   
   # Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   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?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   the macros and arithmetic functions in [datetime.rs](https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/expressions/datetime.rs) are moved to [binary.rs](https://github.com/apache/arrow-datafusion/tree/main/datafusion/physical-expr/src/expressions/binary).
   
   # Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   yes, with existing tests.
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on pull request #5846: Removal of arithmetic operations for temporal values to binary.rs

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #5846:
URL: https://github.com/apache/arrow-datafusion/pull/5846#issuecomment-1503422760

   I plan to review this PR today


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] berkaysynnada commented on pull request #5846: Removal of arithmetic operations for temporal values to binary.rs

Posted by "berkaysynnada (via GitHub)" <gi...@apache.org>.
berkaysynnada commented on PR #5846:
URL: https://github.com/apache/arrow-datafusion/pull/5846#issuecomment-1501116343

   > What I am hoping we can do is to move the temporal logic into kernels such as
   > 
   > ```rust
   > 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
   > 
   > https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/expressions/binary/kernels_arrow.rs
   > 
   > Is this something you can help with @berkaysynnada ?
   
   @alamb would you mind taking a look at this [PR](https://github.com/synnada-ai/arrow-datafusion/pull/83) 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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb merged pull request #5846: Removal of arithmetic operations for temporal values to binary.rs

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #5846:
URL: https://github.com/apache/arrow-datafusion/pull/5846


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] berkaysynnada commented on pull request #5846: Removal of arithmetic operations for temporal values to binary.rs

Posted by "berkaysynnada (via GitHub)" <gi...@apache.org>.
berkaysynnada commented on PR #5846:
URL: https://github.com/apache/arrow-datafusion/pull/5846#issuecomment-1497725564

   > What I am hoping we can do is to move the temporal logic into kernels such as
   > 
   > ```rust
   > 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
   > 
   > https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/expressions/binary/kernels_arrow.rs
   > 
   > 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 can contact me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org