pub struct TableAliasRewriter<'a> {
pub table_schema: &'a Schema,
pub alias_name: TableReference,
}Expand description
A TreeNodeRewriter implementation that rewrites Expr::Column expressions by
replacing the column’s name with an alias if the column exists in the provided schema.
This is typically used to apply table aliases in query plans, ensuring that the column references in the expressions use the correct table alias.
§Fields
table_schema: The schema (SchemaRef) representing the table structure from which the columns are referenced. This is used to look up columns by their names.alias_name: The alias (TableReference) that will replace the table name in the column references when applicable.
Fields§
§table_schema: &'a Schema§alias_name: TableReferenceTrait Implementations§
Source§impl TreeNodeRewriterWithPayload for TableAliasRewriter<'_>
impl TreeNodeRewriterWithPayload for TableAliasRewriter<'_>
type Node = Expr
type Payload<'a> = &'a HashSet<String>
Source§fn f_down(
&mut self,
expr: Expr,
lambdas_params: &HashSet<String>,
) -> Result<Transformed<Expr>>
fn f_down( &mut self, expr: Expr, lambdas_params: &HashSet<String>, ) -> Result<Transformed<Expr>>
Invoked while traversing down the tree before any children are rewritten.
Default implementation returns the node as is and continues recursion.
Source§fn f_up<'a>(
&mut self,
node: Self::Node,
_payload: Self::Payload<'a>,
) -> Result<Transformed<Self::Node>, DataFusionError>
fn f_up<'a>( &mut self, node: Self::Node, _payload: Self::Payload<'a>, ) -> Result<Transformed<Self::Node>, DataFusionError>
Invoked while traversing up the tree after all children have been rewritten.
Default implementation returns the node as is and continues recursion.
Auto Trait Implementations§
impl<'a> Freeze for TableAliasRewriter<'a>
impl<'a> RefUnwindSafe for TableAliasRewriter<'a>
impl<'a> Send for TableAliasRewriter<'a>
impl<'a> Sync for TableAliasRewriter<'a>
impl<'a> Unpin for TableAliasRewriter<'a>
impl<'a> UnwindSafe for TableAliasRewriter<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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