pub trait RegionScanner:
Debug
+ DisplayAs
+ Send {
// Required methods
fn name(&self) -> &str;
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 add_dyn_filter_to_predicate(
&mut self,
filter_exprs: Vec<Arc<dyn PhysicalExpr>>,
) -> Vec<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§
fn name(&self) -> &str
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 add_dyn_filter_to_predicate(
&mut self,
filter_exprs: Vec<Arc<dyn PhysicalExpr>>,
) -> Vec<bool>
fn add_dyn_filter_to_predicate( &mut self, filter_exprs: Vec<Arc<dyn PhysicalExpr>>, ) -> Vec<bool>
Add the given dynamic filter expressions to the predicate of the scanner. Returns a vector of booleans indicating which filter expressions were applied. true indicates the filter expression was applied(will be use by scanner to prune by stat for row group), false otherwise.
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.