Struct MemoryExec

Source
pub struct MemoryExec { /* private fields */ }
๐Ÿ‘ŽDeprecated since 46.0.0: use MemorySourceConfig and DataSourceExec instead
Expand description

Execution plan for reading in-memory batches of data

Implementationsยง

Sourceยง

impl MemoryExec

Source

pub fn try_new( partitions: &[Vec<RecordBatch>], schema: SchemaRef, projection: Option<Vec<usize>>, ) -> Result<Self>

Create a new execution plan for reading in-memory record batches The provided schema should not have the projection applied.

Source

pub fn try_new_as_values( schema: SchemaRef, data: Vec<Vec<Arc<dyn PhysicalExpr>>>, ) -> Result<Self>

Create a new execution plan from a list of constant values (ValuesExec)

Source

pub fn try_new_from_batches( schema: SchemaRef, batches: Vec<RecordBatch>, ) -> Result<Self>

Create a new plan using the provided schema and batches.

Errors if any of the batches donโ€™t match the provided schema, or if no batches are provided.

Source

pub fn with_constraints(self, constraints: Constraints) -> Self

Source

pub fn with_show_sizes(self, show_sizes: bool) -> Self

Set show_sizes to determine whether to display partition sizes

Source

pub fn constraints(&self) -> &Constraints

Ref to constraints

Source

pub fn partitions(&self) -> &[Vec<RecordBatch>]

Ref to partitions

Source

pub fn projection(&self) -> &Option<Vec<usize>>

Ref to projection

Source

pub fn show_sizes(&self) -> bool

Show sizes

Source

pub fn sort_information(&self) -> &[LexOrdering]

Ref to sort information

Source

pub fn try_with_sort_information( self, sort_information: Vec<LexOrdering>, ) -> Result<Self>

A memory table can be ordered by multiple expressions simultaneously. EquivalenceProperties keeps track of expressions that describe the global ordering of the schema. These columns are not necessarily same; e.g.

โ”Œ-------โ”
| a | b |
|---|---|
| 1 | 9 |
| 2 | 8 |
| 3 | 7 |
| 5 | 5 |
โ””---โ”ด---โ”˜

where both a ASC and b DESC can describe the table ordering. With EquivalenceProperties, we can keep track of these equivalences and treat a ASC and b DESC as the same ordering requirement.

Note that if there is an internal projection, that projection will be also applied to the given sort_information.

Source

pub fn original_schema(&self) -> SchemaRef

Arc clone of ref to original schema

Trait Implementationsยง

Sourceยง

impl Clone for MemoryExec

Sourceยง

fn clone(&self) -> MemoryExec

Returns a copy of the value. Read more
1.0.0 ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl Debug for MemoryExec

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl DisplayAs for MemoryExec

Sourceยง

fn fmt_as(&self, t: DisplayFormatType, f: &mut Formatter<'_>) -> Result

Format according to DisplayFormatType, used when verbose representation looks different from the default one Read more
Sourceยง

impl ExecutionPlan for MemoryExec

Sourceยง

fn as_any(&self) -> &dyn Any

Return a reference to Any that can be used for downcasting

Sourceยง

fn statistics(&self) -> Result<Statistics>

We recompute the statistics dynamically from the arrow metadata as it is pretty cheap to do so

Sourceยง

fn name(&self) -> &'static str

Short name for the ExecutionPlan, such as โ€˜DataSourceExecโ€™. Read more
Sourceยง

fn properties(&self) -> &PlanProperties

Return properties of the output of the ExecutionPlan, such as output ordering(s), partitioning information etc. Read more
Sourceยง

fn children(&self) -> Vec<&Arc<dyn ExecutionPlan>>

Get a list of children ExecutionPlans 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>, children: Vec<Arc<dyn ExecutionPlan>>, ) -> Result<Arc<dyn ExecutionPlan>>

Returns a new ExecutionPlan where all existing children were replaced by the children, in order
Sourceยง

fn execute( &self, partition: usize, context: Arc<TaskContext>, ) -> Result<SendableRecordBatchStream>

Begin execution of partition, returning a Stream of RecordBatches. Read more
Sourceยง

fn try_swapping_with_projection( &self, projection: &ProjectionExec, ) -> Result<Option<Arc<dyn ExecutionPlan>>>

Attempts to push down the given projection into the input of this ExecutionPlan. Read more
Sourceยง

fn static_name() -> &'static str
where Self: Sized,

Short name for the ExecutionPlan, such as โ€˜DataSourceExecโ€™. Like name but can be called without an instance.
Sourceยง

fn schema(&self) -> Arc<Schema>

Get the schema for this execution plan
Sourceยง

fn check_invariants( &self, _check: InvariantLevel, ) -> Result<(), DataFusionError>

Returns an error if this individual node does not conform to its invariants. These invariants are typically only checked in debug mode. Read more
Sourceยง

fn required_input_distribution(&self) -> Vec<Distribution>

Specifies the data distribution requirements for all the children for this ExecutionPlan, By default itโ€™s [Distribution::UnspecifiedDistribution] for each child,
Sourceยง

fn required_input_ordering(&self) -> Vec<Option<LexRequirement>>

Specifies the ordering required for all of the children of this ExecutionPlan. Read more
Sourceยง

fn maintains_input_order(&self) -> Vec<bool>

Returns false if this ExecutionPlanโ€™s implementation may reorder rows within or between partitions. Read more
Sourceยง

fn benefits_from_input_partitioning(&self) -> Vec<bool>

Specifies whether the ExecutionPlan benefits from increased parallelization at its input for each child. Read more
Sourceยง

fn repartitioned( &self, _target_partitions: usize, _config: &ConfigOptions, ) -> Result<Option<Arc<dyn ExecutionPlan>>, DataFusionError>

If supported, attempt to increase the partitioning of this ExecutionPlan to produce target_partitions partitions. Read more
Sourceยง

fn metrics(&self) -> Option<MetricsSet>

Return a snapshot of the set of Metrics for this ExecutionPlan. If no Metrics are available, return None. Read more
Sourceยง

fn supports_limit_pushdown(&self) -> bool

Returns true if a limit can be safely pushed down through this ExecutionPlan node. Read more
Sourceยง

fn with_fetch(&self, _limit: Option<usize>) -> Option<Arc<dyn ExecutionPlan>>

Returns a fetching variant of this ExecutionPlan node, if it supports fetch limits. Returns None otherwise.
Sourceยง

fn fetch(&self) -> Option<usize>

Gets the fetch count for the operator, None means there is no fetch.
Sourceยง

fn cardinality_effect(&self) -> CardinalityEffect

Gets the effect on cardinality, if known

Auto Trait Implementationsยง

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> IntoEither for T

Sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> ErasedDestructor for T
where T: 'static,

Sourceยง

impl<T> MaybeSendSync for T