Struct datafusion_python::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) -> NamePreserver
pub fn new(plan: &LogicalPlan) -> NamePreserver
Create a new NamePreserver for rewriting the expr that is part of the specified plan
sourcepub fn new_for_projection() -> NamePreserver
pub fn new_for_projection() -> NamePreserver
Create a new NamePreserver for rewriting the exprs in Projection
This will use aliases
pub fn save(&self, expr: &Expr) -> Result<SavedName, DataFusionError>
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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