Skip to content

Rule — Named Transformation of TreeNodes

Rule is a <> transformation that can be <> to (i.e. executed on or transform) a TreeNode to produce a new 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 <> to, i.e. <>, SparkPlan or <> or a combination thereof.

[[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 <> for a <>.

The other notable use cases of Rule are as follows:


Last update: 2020-11-11