Rule — Named Transformation of TreeNodes¶
Rule
is a <TreeNode
.
[[apply]] [[contract]] [source, scala]
package org.apache.spark.sql.catalyst.rules
abstract class Rule[TreeType <: TreeNode[_]] { // only required properties (vals and methods) that have no implementation // the others follow def apply(plan: TreeType): TreeType }
[[TreeType]] NOTE: TreeType
is the type of the TreeNode implementation that a Rule
can be <
[[ruleName]] Rule
has a rule name (that is the class name of a rule).
[source, scala]¶
ruleName: String¶
Rule
is mainly used to create a <
The other notable use cases of Rule
are as follows:
-
When
ExperimentalMethods
is requested for extraOptimizations -
When
BaseSessionStateBuilder
is requested for <>, < >, < >, and the < > -
When
Analyzer
is requested for extendedResolutionRules and postHocResolutionRules (see BaseSessionStateBuilder and HiveSessionStateBuilder) -
When
Optimizer
is requested for extendedOperatorOptimizationRules -
When
QueryExecution
is requested for preparations