pub struct DataSourceExec { /* private fields */ }
Expand description
ExecutionPlan
that reads one or more files
DataSourceExec
implements common functionality such as applying
projections, and caching plan properties.
The DataSource
describes where to find the data for this data source
(for example in files or what in memory partitions).
For file based DataSource
s, format specific behavior is implemented in
the FileSource
trait.
Implementations§
Source§impl DataSourceExec
impl DataSourceExec
pub fn from_data_source(data_source: impl DataSource + 'static) -> Arc<Self>
pub fn new(data_source: Arc<dyn DataSource>) -> Self
Sourcepub fn data_source(&self) -> &Arc<dyn DataSource>
pub fn data_source(&self) -> &Arc<dyn DataSource>
Return the source object
pub fn with_data_source(self, data_source: Arc<dyn DataSource>) -> Self
Sourcepub fn with_constraints(self, constraints: Constraints) -> Self
pub fn with_constraints(self, constraints: Constraints) -> Self
Assign constraints
Sourcepub fn with_partitioning(self, partitioning: Partitioning) -> Self
pub fn with_partitioning(self, partitioning: Partitioning) -> Self
Assign output partitioning
Sourcepub fn downcast_to_file_source<T: 'static>(
&self,
) -> Option<(&FileScanConfig, &T)>
pub fn downcast_to_file_source<T: 'static>( &self, ) -> Option<(&FileScanConfig, &T)>
Downcast the DataSourceExec
’s data_source
to a specific file source
Returns None
if
- the datasource is not scanning files (
FileScanConfig
) - The
FileScanConfig::file_source
is not of typeT
Trait Implementations§
Source§impl Clone for DataSourceExec
impl Clone for DataSourceExec
Source§fn clone(&self) -> DataSourceExec
fn clone(&self) -> DataSourceExec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DataSourceExec
impl Debug for DataSourceExec
Source§impl DisplayAs for DataSourceExec
impl DisplayAs for DataSourceExec
Source§impl ExecutionPlan for DataSourceExec
impl ExecutionPlan for DataSourceExec
Source§fn repartitioned(
&self,
target_partitions: usize,
config: &ConfigOptions,
) -> Result<Option<Arc<dyn ExecutionPlan>>>
fn repartitioned( &self, target_partitions: usize, config: &ConfigOptions, ) -> Result<Option<Arc<dyn ExecutionPlan>>>
Implementation of ExecutionPlan::repartitioned
which relies upon the inner DataSource::repartitioned
.
If the data source does not support changing its partitioning, returns Ok(None)
(the default). Refer
to ExecutionPlan::repartitioned
for more details.
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Any
so that it can be
downcast to a specific implementation.Source§fn properties(&self) -> &PlanProperties
fn properties(&self) -> &PlanProperties
ExecutionPlan
, such as output
ordering(s), partitioning information etc. Read moreSource§fn children(&self) -> Vec<&Arc<dyn ExecutionPlan>>
fn children(&self) -> Vec<&Arc<dyn ExecutionPlan>>
ExecutionPlan
s that act as inputs to this plan.
The returned list will be empty for leaf nodes such as scans, will contain
a single value for unary nodes, or two values for binary nodes (such as
joins).Source§fn with_new_children(
self: Arc<Self>,
_: Vec<Arc<dyn ExecutionPlan>>,
) -> Result<Arc<dyn ExecutionPlan>>
fn with_new_children( self: Arc<Self>, _: Vec<Arc<dyn ExecutionPlan>>, ) -> Result<Arc<dyn ExecutionPlan>>
ExecutionPlan
where all existing children were replaced
by the children
, in orderSource§fn execute(
&self,
partition: usize,
context: Arc<TaskContext>,
) -> Result<SendableRecordBatchStream>
fn execute( &self, partition: usize, context: Arc<TaskContext>, ) -> Result<SendableRecordBatchStream>
Source§fn metrics(&self) -> Option<MetricsSet>
fn metrics(&self) -> Option<MetricsSet>
Metric
s for this
ExecutionPlan
. If no Metric
s are available, return None. Read moreSource§fn statistics(&self) -> Result<Statistics>
fn statistics(&self) -> Result<Statistics>
partition_statistics
method insteadExecutionPlan
node. If statistics are not
available, should return Statistics::new_unknown
(the default), not
an error. Read moreSource§fn partition_statistics(&self, partition: Option<usize>) -> Result<Statistics>
fn partition_statistics(&self, partition: Option<usize>) -> Result<Statistics>
ExecutionPlan
node.
If statistics are not available, should return Statistics::new_unknown
(the default), not an error.
If partition
is None
, it returns statistics for the entire plan.Source§fn with_fetch(&self, limit: Option<usize>) -> Option<Arc<dyn ExecutionPlan>>
fn with_fetch(&self, limit: Option<usize>) -> Option<Arc<dyn ExecutionPlan>>
ExecutionPlan
node, if it supports
fetch limits. Returns None
otherwise.Source§fn fetch(&self) -> Option<usize>
fn fetch(&self) -> Option<usize>
None
means there is no fetch.Source§fn try_swapping_with_projection(
&self,
projection: &ProjectionExec,
) -> Result<Option<Arc<dyn ExecutionPlan>>>
fn try_swapping_with_projection( &self, projection: &ProjectionExec, ) -> Result<Option<Arc<dyn ExecutionPlan>>>
ExecutionPlan
. Read moreSource§fn handle_child_pushdown_result(
&self,
child_pushdown_result: ChildPushdownResult,
config: &ConfigOptions,
) -> Result<FilterPushdownPropagation<Arc<dyn ExecutionPlan>>>
fn handle_child_pushdown_result( &self, child_pushdown_result: ChildPushdownResult, config: &ConfigOptions, ) -> Result<FilterPushdownPropagation<Arc<dyn ExecutionPlan>>>
ExecutionPlan::gather_filters_for_pushdown
.
Once we know what the result of pushing down filters into children is we ask the current node what it wants to do with that result.
For a DataSourceExec
that may be absorbing the filters to apply them during the scan phase
(also known as late materialization).
A FilterExec
may absorb any filters its children could not absorb, or if there are no filters left it
may remove itself from the plan altogether.
It combines both ChildPushdownResult::parent_filters
and ChildPushdownResult::self_filters
into a single
predicate and replaces it’s own predicate.
Then it passes PredicateSupport::Supported
for each parent predicate to the parent.
A HashJoinExec
may ignore the pushdown result since it needs to apply the filters as part of the join anyhow.
It passes ChildPushdownResult::parent_filters
back up to it’s parents wrapped in FilterPushdownPropagation::transparent
and ChildPushdownResult::self_filters
is discarded. Read moreSource§fn static_name() -> &'static strwhere
Self: Sized,
fn static_name() -> &'static strwhere
Self: Sized,
name
but can be called without an instance.Source§fn check_invariants(
&self,
_check: InvariantLevel,
) -> Result<(), DataFusionError>
fn check_invariants( &self, _check: InvariantLevel, ) -> Result<(), DataFusionError>
Source§fn required_input_distribution(&self) -> Vec<Distribution>
fn required_input_distribution(&self) -> Vec<Distribution>
ExecutionPlan
, By default it’s [Distribution::UnspecifiedDistribution] for each child,Source§fn required_input_ordering(&self) -> Vec<Option<LexRequirement>>
fn required_input_ordering(&self) -> Vec<Option<LexRequirement>>
ExecutionPlan
. Read moreSource§fn maintains_input_order(&self) -> Vec<bool>
fn maintains_input_order(&self) -> Vec<bool>
false
if this ExecutionPlan
’s implementation may reorder
rows within or between partitions. Read moreSource§fn benefits_from_input_partitioning(&self) -> Vec<bool>
fn benefits_from_input_partitioning(&self) -> Vec<bool>
ExecutionPlan
benefits from increased
parallelization at its input for each child. Read moreSource§fn supports_limit_pushdown(&self) -> bool
fn supports_limit_pushdown(&self) -> bool
Source§fn cardinality_effect(&self) -> CardinalityEffect
fn cardinality_effect(&self) -> CardinalityEffect
Source§fn gather_filters_for_pushdown(
&self,
parent_filters: Vec<Arc<dyn PhysicalExpr>>,
_config: &ConfigOptions,
) -> Result<FilterDescription, DataFusionError>
fn gather_filters_for_pushdown( &self, parent_filters: Vec<Arc<dyn PhysicalExpr>>, _config: &ConfigOptions, ) -> Result<FilterDescription, DataFusionError>
ExecutionPlan::gather_filters_for_pushdown
: Read moreSource§impl<S> From<S> for DataSourceExecwhere
S: DataSource + 'static,
Create a new DataSourceExec
from a DataSource
impl<S> From<S> for DataSourceExecwhere
S: DataSource + 'static,
Create a new DataSourceExec
from a DataSource
Auto Trait Implementations§
impl Freeze for DataSourceExec
impl !RefUnwindSafe for DataSourceExec
impl Send for DataSourceExec
impl Sync for DataSourceExec
impl Unpin for DataSourceExec
impl !UnwindSafe for DataSourceExec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more