Skip to content

Improve overflow errors #10805

@andygrove

Description

@andygrove

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions