datafusion
datafusion copied to clipboard
refactor: `SchemaProvider::table` can fail
Which issue does this PR close?
Closes #9305.
Rationale for this change
SchemaProvider::table is async and clearly allows IO:
https://github.com/apache/arrow-datafusion/blob/6fad5ed7a37c50b9c200f214c3e13b0e1f0cecbc/datafusion/core/src/catalog/schema.rs#L114-L116
However this method cannot fail. Casting errors to None is semantically wrong.
What changes are included in this PR?
Change return type from Option<Arc<dyn TableProvider>> to Result<Option<Arc<dyn TableProvider>>, DataFusionError>.
Are these changes tested?
It compiles.
Are there any user-facing changes?
Breaking: Interface change.