pub trait RegionScanner:
Debug
+ DisplayAs
+ Send {
// Required methods
fn properties(&self) -> &ScannerProperties;
fn schema(&self) -> SchemaRef;
fn metadata(&self) -> RegionMetadataRef;
fn prepare(
&mut self,
ranges: Vec<Vec<PartitionRange>>,
distinguish_partition_range: bool,
) -> Result<(), BoxedError>;
fn scan_partition(
&self,
partition: usize,
) -> Result<SendableRecordBatchStream, BoxedError>;
fn has_predicate(&self) -> bool;
}
Expand description
A scanner that provides a way to scan the region concurrently.
The scanner splits the region into partitions so that each partition can be scanned concurrently.
You can use this trait to implement an ExecutionPlan
.
Required Methods§
sourcefn properties(&self) -> &ScannerProperties
fn properties(&self) -> &ScannerProperties
Returns the properties of the scanner.
sourcefn metadata(&self) -> RegionMetadataRef
fn metadata(&self) -> RegionMetadataRef
Returns the metadata of the region.
sourcefn prepare(
&mut self,
ranges: Vec<Vec<PartitionRange>>,
distinguish_partition_range: bool,
) -> Result<(), BoxedError>
fn prepare( &mut self, ranges: Vec<Vec<PartitionRange>>, distinguish_partition_range: bool, ) -> Result<(), BoxedError>
Prepares the scanner with the given partition ranges.
This method is for the planner to adjust the scanner’s behavior based on the partition ranges.
sourcefn scan_partition(
&self,
partition: usize,
) -> Result<SendableRecordBatchStream, BoxedError>
fn scan_partition( &self, partition: usize, ) -> Result<SendableRecordBatchStream, BoxedError>
Scans the partition and returns a stream of record batches.
§Panics
Panics if the partition
is out of bound.
sourcefn has_predicate(&self) -> bool
fn has_predicate(&self) -> bool
Check if there is any predicate that may be executed in this scanner.