Apache DataFusion SQL Query Engine
Make FileStream and FileOpener public (#3514)
Dan Harris4380f355e410
diff --git a/datafusion/core/src/physical_plan/file_format/file_stream.rs b/datafusion/core/src/physical_plan/file_format/file_stream.rsindex 1a54d68522..609e3b3a9b 100644--- a/datafusion/core/src/physical_plan/file_format/file_stream.rs+++ b/datafusion/core/src/physical_plan/file_format/file_stream.rs@@ -51,7 +51,11 @@ use crate::physical_plan::RecordBatchStream;pub type FileOpenFuture =BoxFuture<'static, Result<BoxStream<'static, ArrowResult<RecordBatch>>>>;+/// Generic API for opening a file using an [`ObjectStore`] and resolving to a+/// stream of [`RecordBatch`]pub trait FileOpener: Unpin {+ /// Asynchronously open the specified file and return a stream+ /// of [`RecordBatch`]fn open(&self,store: Arc<dyn ObjectStore>,@@ -167,6 +171,7 @@ impl FileStreamMetrics {}impl<F: FileOpener> FileStream<F> {+ /// Create a new `FileStream` using the give `FileOpener` to scan underlying filespub fn new(config: &FileScanConfig,partition: usize,diff --git a/datafusion/core/src/physical_plan/file_format/mod.rs b/datafusion/core/src/physical_plan/file_format/mod.rsindex 707ed039c2..2d59570078 100644--- a/datafusion/core/src/physical_plan/file_format/mod.rs+++ b/datafusion/core/src/physical_plan/file_format/mod.rs@@ -39,6 +39,7 @@ use arrow::{record_batch::RecordBatch,};pub use avro::AvroExec;+pub use file_stream::{FileOpenFuture, FileOpener, FileStream};pub(crate) use json::plan_to_json;pub use json::NdJsonExec;