pub struct ProjectionMapping {
    pub map: Vec<(Arc<dyn PhysicalExpr>, Arc<dyn PhysicalExpr>)>,
}
Expand description

Stores the mapping between source expressions and target expressions for a projection.

Fields§

§map: Vec<(Arc<dyn PhysicalExpr>, Arc<dyn PhysicalExpr>)>

Mapping between source expressions and target expressions. Vector indices correspond to the indices after projection.

Implementations§

source§

impl ProjectionMapping

source

pub fn try_new( expr: &[(Arc<dyn PhysicalExpr>, String)], input_schema: &Arc<Schema> ) -> Result<ProjectionMapping, DataFusionError>

Constructs the mapping between a projection’s input and output expressions.

For example, given the input projection expressions (a + b, c + d) and an output schema with two columns "c + d" and "a + b", the projection mapping would be:

 [0]: (c + d, col("c + d"))
 [1]: (a + b, col("a + b"))

where col("c + d") means the column named "c + d".

source

pub fn iter( &self ) -> impl Iterator<Item = &(Arc<dyn PhysicalExpr>, Arc<dyn PhysicalExpr>)>

Iterate over pairs of (source, target) expressions

source

pub fn target_expr( &self, expr: &Arc<dyn PhysicalExpr> ) -> Option<Arc<dyn PhysicalExpr>>

This function returns the target expression for a given source expression.

§Arguments
  • expr - Source physical expression.
§Returns

An Option containing the target for the given source expression, where a None value means that expr is not inside the mapping.

Trait Implementations§

source§

impl Clone for ProjectionMapping

source§

fn clone(&self) -> ProjectionMapping

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 ProjectionMapping

source§

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

Formats the value using the given formatter. Read more

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> 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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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