public class LoptJoinTree extends Object
Join tree
and the factors that make up the tree.
Because RelNodes 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.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
LoptJoinTree.BinaryTree
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 |
LoptJoinTree.Leaf
Binary tree node that has no children.
|
protected static class |
LoptJoinTree.Node
Binary tree node that has two children.
|
| Constructor and Description |
|---|
LoptJoinTree(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.
|
| Modifier and Type | Method and Description |
|---|---|
LoptJoinTree.BinaryTree |
getFactorTree() |
RelNode |
getJoinTree() |
LoptJoinTree |
getLeft() |
LoptJoinTree |
getRight() |
List<Integer> |
getTreeOrder() |
void |
getTreeOrder(List<Integer> treeOrder) |
boolean |
isRemovableSelfJoin() |
public LoptJoinTree(RelNode joinTree, int factorId)
joinTree - RelNode corresponding to the single nodefactorId - factor id of the nodepublic LoptJoinTree(RelNode joinTree, LoptJoinTree.BinaryTree factorTree, boolean removableSelfJoin)
joinTree - RelNodes corresponding to the join treefactorTree - tree of the factor idsremovableSelfJoin - whether the join corresponds to a removable
self-joinpublic LoptJoinTree(RelNode joinTree, LoptJoinTree.BinaryTree leftFactorTree, LoptJoinTree.BinaryTree rightFactorTree)
joinTree - RelNodes corresponding to the join treeleftFactorTree - tree of the factor ids for left subtreerightFactorTree - tree of the factor ids for the right subtreepublic LoptJoinTree(RelNode joinTree, LoptJoinTree.BinaryTree leftFactorTree, LoptJoinTree.BinaryTree rightFactorTree, boolean removableSelfJoin)
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-joinpublic RelNode getJoinTree()
public LoptJoinTree getLeft()
public LoptJoinTree getRight()
public LoptJoinTree.BinaryTree getFactorTree()
public boolean isRemovableSelfJoin()
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.