Trait datafusion::physical_plan::ExecutionPlan [−][src]
pub trait ExecutionPlan: Debug + Send + Sync {
fn as_any(&self) -> &dyn Any;
fn schema(&self) -> SchemaRef;
fn output_partitioning(&self) -> Partitioning;
fn children(&self) -> Vec<Arc<dyn ExecutionPlan>>ⓘ;
fn with_new_children(
&self,
children: Vec<Arc<dyn ExecutionPlan>>
) -> Result<Arc<dyn ExecutionPlan>>;
fn execute<'life0, 'async_trait>(
&'life0 self,
partition: usize
) -> Pin<Box<dyn Future<Output = Result<SendableRecordBatchStream>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn statistics(&self) -> Statistics;
fn required_child_distribution(&self) -> Distribution { ... }
fn metrics(&self) -> Option<MetricsSet> { ... }
fn fmt_as(&self, _t: DisplayFormatType, f: &mut Formatter<'_>) -> Result { ... }
}
Expand description
ExecutionPlan
represent nodes in the DataFusion Physical Plan.
Each ExecutionPlan
is Partition-aware and is responsible for
creating the actual async
SendableRecordBatchStream
s
of RecordBatch
that incrementally compute the operator’s
output from its input partition.
ExecutionPlan
can be displayed in an simplified form using the
return value from displayable
in addition to the (normally
quite verbose) Debug
output.
Required methods
Returns the execution plan as Any
so that it can be
downcast to a specific implementation.
fn output_partitioning(&self) -> Partitioning
fn output_partitioning(&self) -> Partitioning
Specifies the output partitioning scheme of this plan
Get a list of child execution plans that provide the input for this plan. The returned list will be empty for leaf nodes, will contain a single value for unary nodes, or two values for binary nodes (such as joins).
fn with_new_children(
&self,
children: Vec<Arc<dyn ExecutionPlan>>
) -> Result<Arc<dyn ExecutionPlan>>
fn with_new_children(
&self,
children: Vec<Arc<dyn ExecutionPlan>>
) -> Result<Arc<dyn ExecutionPlan>>
Returns a new plan where all children were replaced by new plans.
The size of children
must be equal to the size of ExecutionPlan::children()
.
creates an iterator
fn statistics(&self) -> Statistics
fn statistics(&self) -> Statistics
Returns the global output statistics for this ExecutionPlan
node.
Provided methods
fn required_child_distribution(&self) -> Distribution
fn required_child_distribution(&self) -> Distribution
Specifies the data distribution requirements of all the children for this operator
fn metrics(&self) -> Option<MetricsSet>
fn metrics(&self) -> Option<MetricsSet>
Return a snapshot of the set of Metric
s for this
ExecutionPlan
.
While the values of the metrics in the returned
MetricsSet
s may change as execution progresses, the
specific metrics will not.
Once self.execute()
has returned (technically the future is
resolved) for all available partitions, the set of metrics
should be complete. If this function is called prior to
execute()
new metrics may appear in subsequent calls.
fn fmt_as(&self, _t: DisplayFormatType, f: &mut Formatter<'_>) -> Result
fn fmt_as(&self, _t: DisplayFormatType, f: &mut Formatter<'_>) -> Result
Format this ExecutionPlan
to f
in the specified type.
Should not include a newline
Note this function prints a placeholder by default to preserve backwards compatibility.