pub trait DataSource {
// Required method
fn get_stream(
&self,
request: ScanRequest,
) -> Result<SendableRecordBatchStream, BoxedError>;
// Provided method
fn get_physical_plan(
&self,
_request: ScanRequest,
) -> Result<Option<Arc<dyn ExecutionPlan>>, BoxedError> { ... }
}Expand description
This trait represents a common data source abstraction which provides an interface for retrieving data in the form of a stream of record batches.
Required Methods§
Sourcefn get_stream(
&self,
request: ScanRequest,
) -> Result<SendableRecordBatchStream, BoxedError>
fn get_stream( &self, request: ScanRequest, ) -> Result<SendableRecordBatchStream, BoxedError>
Retrieves a stream of record batches based on the provided scan request.
Provided Methods§
Sourcefn get_physical_plan(
&self,
_request: ScanRequest,
) -> Result<Option<Arc<dyn ExecutionPlan>>, BoxedError>
fn get_physical_plan( &self, _request: ScanRequest, ) -> Result<Option<Arc<dyn ExecutionPlan>>, BoxedError>
Builds a physical plan for the scan request if the data source needs to expose its execution semantics to DataFusion.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".