Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DataFusionError in SendableRecordBatchStream #5039

Closed
tustvold opened this issue Jan 24, 2023 · 2 comments · Fixed by #5101
Closed

Use DataFusionError in SendableRecordBatchStream #5039

tustvold opened this issue Jan 24, 2023 · 2 comments · Fixed by #5101
Labels
enhancement New feature or request

Comments

@tustvold
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The is a significant amount of logic converting from DataFusionError to ArrowError and back, a large amount of which originates from the fact SendableRecordBatchStream returns ArrowError instead of DataFusionError

Describe the solution you'd like

It seems strange that the DataFusion stream abstraction would not return DataFusion's error type. I would like to change SendableRecordBatchStream to

pub trait RecordBatchStream: Stream<Item = Result<RecordBatch, DataFusionError>> {
    /// Returns the schema of this `RecordBatchStream`.
    ///
    /// Implementation of this trait should guarantee that all `RecordBatch`'s returned by this
    /// stream should have the same schema as returned from this method.
    fn schema(&self) -> SchemaRef;
}

Describe alternatives you've considered
We could not do this

Additional context
Add any other context or screenshots about the feature request here.

@tustvold tustvold added the enhancement New feature or request label Jan 24, 2023
@comphead
Copy link
Contributor

comphead commented Jan 25, 2023

That sounds good, DatafusionError and ArrowError are not 1 to 1 match, but we can expand it if needed or still use DatafusionError::ArrowError to wrap Arrow errors. Hope I can crunch it

@crepererum
Copy link
Contributor

Dup of #4172.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants