Package org.apache.calcite.rel.rules
Class LoptJoinTree
java.lang.Object
org.apache.calcite.rel.rules.LoptJoinTree
Utility class used to store a
Join
tree
and the factors that make up the tree.
Because RelNode
s can be duplicated in a query
when you have a self-join, factor ids are needed to distinguish between the
different join inputs that correspond to identical tables. The class
associates factor ids with a join tree, matching the order of the factor ids
with the order of those factors in the join tree.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Simple binary tree class that stores an id in the leaf nodes and keeps track of the parent LoptJoinTree object associated with the binary tree.protected static class
Binary tree node that has no children.protected static class
Binary tree node that has two children. -
Constructor Summary
ConstructorDescriptionLoptJoinTree
(RelNode joinTree, int factorId) Creates a join-tree consisting of a single node.LoptJoinTree
(RelNode joinTree, LoptJoinTree.BinaryTree factorTree, boolean removableSelfJoin) Associates the factor ids with a join-tree.LoptJoinTree
(RelNode joinTree, LoptJoinTree.BinaryTree leftFactorTree, LoptJoinTree.BinaryTree rightFactorTree) Associates the factor ids with a join-tree given the factors corresponding to the left and right subtrees of the join.LoptJoinTree
(RelNode joinTree, LoptJoinTree.BinaryTree leftFactorTree, LoptJoinTree.BinaryTree rightFactorTree, boolean removableSelfJoin) Associates the factor ids with a join-tree given the factors corresponding to the left and right subtrees of the join. -
Method Summary
Modifier and TypeMethodDescriptiongetLeft()
getRight()
void
getTreeOrder
(List<Integer> treeOrder) boolean
-
Constructor Details
-
LoptJoinTree
Creates a join-tree consisting of a single node.- Parameters:
joinTree
- RelNode corresponding to the single nodefactorId
- factor id of the node
-
LoptJoinTree
public LoptJoinTree(RelNode joinTree, LoptJoinTree.BinaryTree factorTree, boolean removableSelfJoin) Associates the factor ids with a join-tree.- Parameters:
joinTree
- RelNodes corresponding to the join treefactorTree
- tree of the factor idsremovableSelfJoin
- whether the join corresponds to a removable self-join
-
LoptJoinTree
public LoptJoinTree(RelNode joinTree, LoptJoinTree.BinaryTree leftFactorTree, LoptJoinTree.BinaryTree rightFactorTree) Associates the factor ids with a join-tree given the factors corresponding to the left and right subtrees of the join.- Parameters:
joinTree
- RelNodes corresponding to the join treeleftFactorTree
- tree of the factor ids for left subtreerightFactorTree
- tree of the factor ids for the right subtree
-
LoptJoinTree
public LoptJoinTree(RelNode joinTree, LoptJoinTree.BinaryTree leftFactorTree, LoptJoinTree.BinaryTree rightFactorTree, boolean removableSelfJoin) Associates the factor ids with a join-tree given the factors corresponding to the left and right subtrees of the join. Also indicates whether the join is a removable self-join.- Parameters:
joinTree
- RelNodes corresponding to the join treeleftFactorTree
- tree of the factor ids for left subtreerightFactorTree
- tree of the factor ids for the right subtreeremovableSelfJoin
- true if the join is a removable self-join
-
-
Method Details
-
getJoinTree
-
getLeft
-
getRight
-
getFactorTree
-
getTreeOrder
-
getTreeOrder
-
isRemovableSelfJoin
public boolean isRemovableSelfJoin()
-