Class EliminateCrossJoins
- java.lang.Object
-
- io.prestosql.sql.planner.iterative.rule.EliminateCrossJoins
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.prestosql.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description EliminateCrossJoins(Metadata metadata)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule.Result
apply(JoinNode node, Captures captures, Rule.Context context)
static PlanNode
buildJoinTree(List<Symbol> expectedOutputSymbols, JoinGraph graph, List<Integer> joinOrder, PlanNodeIdAllocator idAllocator)
static List<Integer>
getJoinOrder(JoinGraph graph)
Given JoinGraph determine the order of joins between graph nodes by traversing JoinGraph.Pattern<JoinNode>
getPattern()
Returns a pattern to which plan nodes this rule applies.boolean
isEnabled(Session session)
static boolean
isOriginalOrder(List<Integer> joinOrder)
-
-
-
Constructor Detail
-
EliminateCrossJoins
public EliminateCrossJoins(Metadata metadata)
-
-
Method Detail
-
getPattern
public Pattern<JoinNode> getPattern()
Description copied from interface:Rule
Returns a pattern to which plan nodes this rule applies.- Specified by:
getPattern
in interfaceRule<JoinNode>
-
isEnabled
public boolean isEnabled(Session session)
-
apply
public Rule.Result apply(JoinNode node, Captures captures, Rule.Context context)
-
getJoinOrder
public static List<Integer> getJoinOrder(JoinGraph graph)
Given JoinGraph determine the order of joins between graph nodes by traversing JoinGraph. Any graph traversal algorithm could be used here (like BFS or DFS), but we use PriorityQueue to preserve original JoinOrder as mush as it is possible. PriorityQueue returns next nodes to join in order of their occurrence in original Plan.
-
-