Module error

Module error 

Source
Expand description

§Error Handling in DataFusion

In DataFusion, there are two types of errors that can be raised:

  1. Expected errors – These indicate invalid operations performed by the caller, such as attempting to open a non-existent file. Different categories exist to distinguish their sources (e.g., DataFusionError::ArrowError, DataFusionError::IoError, etc.).

  2. Unexpected errors – Represented by DataFusionError::Internal, these indicate that an internal invariant has been broken, suggesting a potential bug in the system.

There are several convenient macros for throwing errors. For example, use exec_err! for expected errors. For invariant checks, you can use assert_or_internal_err!, assert_eq_or_internal_err!, assert_ne_or_internal_err! for easier assertions. On the performance-critical path, use debug_assert! instead to reduce overhead.

Macros§

_schema_err

Structs§

DataFusionErrorBuilder
A builder for DataFusionError

Enums§

DataFusionError
DataFusion error
SchemaError
Schema-related errors

Functions§

add_possible_columns_to_diag
field_not_found
Create a “field not found” DataFusion::SchemaError
unqualified_field_not_found
Convenience wrapper over field_not_found for when there is no qualifier

Type Aliases§

GenericError
Error type for generic operations that could result in DataFusionError::External
Result
Result type for operations that could result in an DataFusionError
SharedResult
Result type for operations that could result in an DataFusionError and needs to be shared (wrapped into Arc).