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
impl ProjectionMapping
sourcepub fn try_new(
expr: &[(Arc<dyn PhysicalExpr>, String)],
input_schema: &SchemaRef,
) -> Result<Self>
pub fn try_new( expr: &[(Arc<dyn PhysicalExpr>, String)], input_schema: &SchemaRef, ) -> Result<Self>
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"
.
sourcepub fn iter(
&self,
) -> impl Iterator<Item = &(Arc<dyn PhysicalExpr>, Arc<dyn PhysicalExpr>)> + '_
pub fn iter( &self, ) -> impl Iterator<Item = &(Arc<dyn PhysicalExpr>, Arc<dyn PhysicalExpr>)> + '_
Iterate over pairs of (source, target) expressions
sourcepub fn target_expr(
&self,
expr: &Arc<dyn PhysicalExpr>,
) -> Option<Arc<dyn PhysicalExpr>>
pub fn target_expr( &self, expr: &Arc<dyn PhysicalExpr>, ) -> Option<Arc<dyn PhysicalExpr>>
Trait Implementations§
source§impl Clone for ProjectionMapping
impl Clone for ProjectionMapping
source§fn clone(&self) -> ProjectionMapping
fn clone(&self) -> ProjectionMapping
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ProjectionMapping
impl !RefUnwindSafe for ProjectionMapping
impl Send for ProjectionMapping
impl Sync for ProjectionMapping
impl Unpin for ProjectionMapping
impl !UnwindSafe for ProjectionMapping
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
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 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>
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