Improve overflow errors
- Dominant language
- Rust
- Stars
- 9.3k
- Forks
- 2.4k
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 344
Description
### Is your feature request related to a problem or challenge?
In downstream crates such as Comet, we don't have a good way to catch overflow errors from DataFusion/Arrow. We have to rely on looking for certain words in error messages. For example:
```rust
match self.inner_abs_func.invoke(args) {
Ok(result) => Ok(result),
Err(DataFusionError::ArrowError(ArrowError::ComputeError(msg), trace)) if msg.contains("overflow") => { ... }
```
We then create a specific overflow exception:
```rust
CometError::ArithmeticOverflow {
from_type: from_type.to_string(),
}
```
### Describe the solution you'd like
It would be a better developer experience if DataFusion/Arrow had specific overflow errors. I see that Arrow already has `DivideByZero` so it seems logical that we could also have an `Overflow` or `ArithmeticOverflow` as well. I will file an issue in Arrow and link to it from this issue.
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
Contributor guide
Research direction
No files, tests, or entry points are named. Start by reviewing how DataFusion currently propagates Arrow compute errors and how downstream code matches them. Done means overflow is represented by a specific error that downstream crates can catch without inspecting message text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- data-engineering
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100