public class PlanUtils extends java.lang.ObjectA collection of helpful utilities that can be used for generating, analyzing and manipulating query execution plans.
Constructors Modifier Constructor Description
PlanUtils()This class should not be instantiated.
All Methods Static Methods Concrete Methods Modifier and Type Method Description
addPredicateToPlan(PlanNode plan, Expression predicate)This helper function takes a query plan and a selection predicate, and adds the predicate to the plan in a reasonably intelligent way.
public static PlanNode addPredicateToPlan(PlanNode plan, Expression predicate)This helper function takes a query plan and a selection predicate, and adds the predicate to the plan in a reasonably intelligent way.
If the plan is a subclass of the
SelectNodethen the select node's predicate is updated to include the predicate. Specifically, if the select node already has a predicate then one of the following occurs:
- If the select node currently has no predicate, the new predicate is assigned to the select node.
- If the select node has a predicate whose top node is a
BooleanOperatorof type AND, this predicate is added as a new term on that node.
- If the select node has some other kind of non-null predicate then this method creates a new top-level AND operation that will combine the two predicates into one.
plan- the plan to add the selection predicate to
predicate- the selection predicate to add to the plan
- the (possibly new) top plan-node for the plan with the selection predicate applied