Skip to main content

DataSource

Trait DataSource 

Source
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§

Source

fn get_stream( &self, request: ScanRequest, ) -> Result<SendableRecordBatchStream, BoxedError>

Retrieves a stream of record batches based on the provided scan request.

Provided Methods§

Source

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".

Implementors§