Commits

Jorge C. Leitao authored f06c68a48bc
ARROW-10331: [Rust] [DataFusion] Re-organize DataFusion errors This PR: * Renamed `ExecutionError` to `DataFusionError` * Renamed `DataFusionError::ParserError` to `DataFusionError::SQL` * Renamed `DataFusionError::InternalError` to `DataFusionError::Internal` * Renamed `DataFusionError::ExecutionError` to `DataFusionError::Execution` * Adds a new error variant `DataFusionError::Plan` that is used during planning * Removes `DataFusionError::InvalidColumn` that was not being used. * Removes `DataFusionError::General`, replacing them by the appropriate errors * Improves the message of `DataFusionError::Internal` to incentivize users to file a bug report when it happens * Extended the documentation of every variant The design behind this PR is that the error variants should correspond to what happened: * `Internal`: a Datafusion's internal invariant was violated (e.g. downcast failed) => file a bug report * `Plan`: planning was incorrect * `NotImplemented`: something is not implemented and we know about it. Ideally, we should have an associated JIRA issue * `Execution`: an error during execution. We should avoid raising these, but sometimes it is impossible. * `IoError`: stuff related with reading and writing I went through every error that we return in `DataFusion` and verified that it is assigned correctly to one of these variants. I am a bit uncertain about the `ParquetError` and `ArrowError`. IMO `ArrowError` should be mapped to `DataFusionError::Execution`, as it only happens during execution, and `ParquetError` should be mapped to an `IoError`. I also think that we should split `NotImplemented` in two: `NotImplemented` and `NotSupported` as e.g. `float16` is something that we will likely never support, while "modulus" is just not implemented yet. Closes #8481 from jorgecarleitao/error Authored-by: Jorge C. Leitao <jorgecarleitao@gmail.com> Signed-off-by: Jorge C. Leitao <jorgecarleitao@gmail.com>