datafusion-comet icon indicating copy to clipboard operation
datafusion-comet copied to clipboard

Remove "Execution error: " prefix from error messages from Rust

Open andygrove opened this issue 10 months ago • 6 comments

What is the problem the feature request solves?

We cannot exactly match Spark error messages in some cases because DataFusion is prefixing errors from Rust with "Execution error: ".

Because we are ultimately implementing traits from DataFusion, any CometErrors we create get converted into DataFusion errors:

impl From<CometError> for DataFusionError {
    fn from(value: CometError) -> Self {
        match value {
            CometError::DataFusion { source } => source,
            _ => DataFusionError::Execution(value.to_string()),
        }
    }
}

In errors.rs we use thiserror for formatting errors and we delegate formatting to DataFusion for DataFusionError:

#[error(transparent)]
DataFusion {
    #[from]
    source: DataFusionError,
},

DataFusion adds an "Execution error: " prefix in its formatting:

DataFusionError::Execution(ref desc) => {
    write!(f, "Execution error: {desc}")
}

Describe the potential solution

There seem to be two options:

  1. Add a new variant to DataFusionError which does not do any additional formatting and just returns the underlying error string
  2. Find a work around in the mapping using thiserror

Additional context

No response

andygrove avatar Apr 19 '24 21:04 andygrove