Skip to content

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

@andygrove

Description

@andygrove

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

Metadata

Metadata

Assignees

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