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