EliminateSubqueryAliases Logical Optimization

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].

// 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

apply(plan: LogicalPlan): LogicalPlan
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.

results matching ""

    No results matching ""