EliminateSubqueryAliases Logical Optimization
EliminateSubqueryAliases
is a base logical optimization that removes (eliminates) SubqueryAlias logical operators from a logical query plan.
EliminateSubqueryAliases
is part of the Finish Analysis once-executed batch in the standard batches of the Catalyst Optimizer.
EliminateSubqueryAliases
is simply a Catalyst rule for transforming logical plans, i.e. Rule[LogicalPlan]
.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// 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
Method
1 2 3 4 5 |
apply(plan: LogicalPlan): LogicalPlan |
Note
|
apply is part of the Rule Contract to execute (apply) a rule on a TreeNode (e.g. LogicalPlan).
|
apply
simply removes (eliminates) SubqueryAlias unary logical operators from the input logical plan.