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 from_indices(indices: &[usize], schema: &SchemaRef) -> Result<Self>
pub fn from_indices(indices: &[usize], schema: &SchemaRef) -> Result<Self>
Constructs a subset mapping using the provided indices.
This is used when the output is a subset of the input without any other transformations. The indices are for columns in the schema.
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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