pub trait RegionScanner:
Debug
+ DisplayAs
+ Send {
// Required methods
fn properties(&self) -> &ScannerProperties;
fn schema(&self) -> SchemaRef;
fn metadata(&self) -> RegionMetadataRef;
fn prepare(&mut self, request: PrepareRequest) -> Result<(), BoxedError>;
fn scan_partition(
&self,
ctx: &QueryScanContext,
metrics_set: &ExecutionPlanMetricsSet,
partition: usize,
) -> Result<SendableRecordBatchStream, BoxedError>;
fn has_predicate_without_region(&self) -> bool;
fn set_logical_region(&mut self, logical_region: 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, request: PrepareRequest) -> Result<(), BoxedError>
fn prepare(&mut self, request: PrepareRequest) -> 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,
ctx: &QueryScanContext,
metrics_set: &ExecutionPlanMetricsSet,
partition: usize,
) -> Result<SendableRecordBatchStream, BoxedError>
fn scan_partition( &self, ctx: &QueryScanContext, metrics_set: &ExecutionPlanMetricsSet, 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_without_region(&self) -> bool
fn has_predicate_without_region(&self) -> bool
Check if there is any predicate exclude region partition exprs that may be executed in this scanner.
Sourcefn set_logical_region(&mut self, logical_region: bool)
fn set_logical_region(&mut self, logical_region: bool)
Sets whether the scanner is reading a logical region.