MCPcopy Create free account
hub / github.com/apache/datafusion / apply_table_alias

Method apply_table_alias

datafusion/sql/src/planner.rs:545–558  ·  view source on GitHub ↗

Apply the given TableAlias to the input plan

(
        &self,
        plan: LogicalPlan,
        alias: TableAlias,
    )

Source from the content-addressed store, hash-verified

543
544 /// Apply the given TableAlias to the input plan
545 pub(crate) fn apply_table_alias(
546 &self,
547 plan: LogicalPlan,
548 alias: TableAlias,
549 ) -> Result<LogicalPlan> {
550 let idents = alias.columns.into_iter().map(|c| c.name).collect();
551 let plan = self.apply_expr_alias(plan, idents)?;
552
553 LogicalPlanBuilder::from(plan)
554 .alias(TableReference::bare(
555 self.ident_normalizer.normalize(alias.name),
556 ))?
557 .build()
558 }
559
560 pub(crate) fn apply_expr_alias(
561 &self,

Callers 3

plan_with_clauseMethod · 0.80
pipe_operatorMethod · 0.80
create_relationMethod · 0.80

Calls 7

collectMethod · 0.80
apply_expr_aliasMethod · 0.80
mapMethod · 0.45
into_iterMethod · 0.45
buildMethod · 0.45
aliasMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected