Skip to content

EliminateSubqueryAliases Logical Optimization

EliminateSubqueryAliases is a base logical optimization that <>.

EliminateSubqueryAliases is part of the Finish Analysis once-executed batch in the standard batches of the Logical Optimizer.

EliminateSubqueryAliases is simply a <> for transforming <>, i.e. Rule[LogicalPlan].

[source, scala]

// Using Catalyst DSL import org.apache.spark.sql.catalyst.dsl.plans._ val t1 = table("t1") val logicalPlan = t1.subquery('a)

import org.apache.spark.sql.catalyst.analysis.EliminateSubqueryAliases val afterEliminateSubqueryAliases = EliminateSubqueryAliases(logicalPlan) scala> println(afterEliminateSubqueryAliases.numberedTreeString) 00 'UnresolvedRelation t1


Executing Rule

apply(plan: LogicalPlan): LogicalPlan

apply simply removes (eliminates) <> unary logical operators from the input <>.

apply is part of the Rule abstraction.