You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2024/07/26 15:59:09 UTC

[PR] Add ArrowError::ArithmeticError [arrow-rs]

andygrove opened a new pull request, #6130:
URL: https://github.com/apache/arrow-rs/pull/6130

   # 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.
   -->
   
   N/A
   
   This replaces PR https://github.com/apache/arrow-rs/pull/5845
   
   # 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.
   -->
   
   Downstream crates (such as DataFusion Comet) often need specific handling for overflow errors and we currently have no good way to detect them other than looking for specific words in error messages, which is not very robust. For example, we currently have code like this:
   
   ```rust
   match self.inner_abs_func.invoke(args) {
       Err(DataFusionError::ArrowError(ArrowError::ComputeError(msg), trace)) if msg.contains("overflow") => { ... }
   ```
   
   It would be better if Arrow had an `ArithmeticOverflow` variant in the `ArrowError` enum, similar to the existing `DivideByZero` variant.
   
   # 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.
   -->
   
   Add `ArithmeticOverflow` and update existing overflow handling.
   
   # Are there any user-facing changes?
   
   Yes, overflows will produce a different error now.
   
   
   <!--
   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 `breaking 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


Re: [PR] Add ArrowError::ArithmeticError [arrow-rs]

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


-- 
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