Struct datafusion_optimizer::utils::NamePreserver
source · pub struct NamePreserver { /* private fields */ }
Expand description
Handles ensuring the name of rewritten expressions is not changed.
For example, if an expression 1 + 2
is rewritten to 3
, the name of the
expression should be preserved: 3 as "1 + 2"
See https://github.com/apache/datafusion/issues/3555 for details
Implementations§
source§impl NamePreserver
impl NamePreserver
sourcepub fn new(plan: &LogicalPlan) -> Self
pub fn new(plan: &LogicalPlan) -> Self
Create a new NamePreserver for rewriting the expr
that is part of the specified plan
sourcepub fn new_for_projection() -> Self
pub fn new_for_projection() -> Self
Create a new NamePreserver for rewriting the expr
s in Projection
This will use aliases
pub fn save(&self, expr: &Expr) -> Result<SavedName>
Auto Trait Implementations§
impl Freeze for NamePreserver
impl RefUnwindSafe for NamePreserver
impl Send for NamePreserver
impl Sync for NamePreserver
impl Unpin for NamePreserver
impl UnwindSafe for NamePreserver
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> 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