Catalyst Rule — Named Transformation of TreeNodes

Rule is a named transformation that can be applied to (i.e. executed on or transform) a TreeNode to produce a new TreeNode.

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
}
Note
TreeType is the type of the TreeNode implementation that a Rule can be applied to, i.e. LogicalPlan, SparkPlan or Expression or a combination thereof.

Rule has a rule name (that is the class name of a rule).

ruleName: String

Rule is mainly used to create a batch of rules for a RuleExecutor.

The other notable use cases of Rule are as follows:

results matching ""

    No results matching ""