public HiveLoptJoinTree getRight() {
    final HiveLoptJoinTree.Node node = (HiveLoptJoinTree.Node) factorTree;
    return new HiveLoptJoinTree(
            ((Join) joinTree).getRight(),
            node.getRight(),
            node.getRight().getParent().isRemovableSelfJoin());
  }
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.

@param joinTree RelNodes corresponding to the join tree
@param leftFactorTree tree of the factor ids for left subtree
@param rightFactorTree tree of the factor ids for the right subtree
@param removableSelfJoin true if the join is a removable self-join
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveLoptJoinTree.java