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

Improve overflow errors #10805

Open
andygrove opened this issue Jun 5, 2024 · 1 comment
Open

Improve overflow errors #10805

andygrove opened this issue Jun 5, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@andygrove
Copy link
Member

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:

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:

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

@andygrove andygrove added the enhancement New feature or request label Jun 5, 2024
@andygrove
Copy link
Member Author

I created a PR against arrow-rs to add this new error variant:

apache/arrow-rs#5845

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

No branches or pull requests

1 participant