Search in sources :

Example 1 with JoinPrel

use of org.apache.drill.exec.planner.physical.JoinPrel in project drill by apache.

the class JoinPrelRenameVisitor method visitJoin.

@Override
public Prel visitJoin(JoinPrel prel, Void value) throws RuntimeException {
    List<RelNode> children = Lists.newArrayList();
    for (Prel child : prel) {
        child = child.accept(this, null);
        children.add(child);
    }
    final int leftCount = children.get(0).getRowType().getFieldCount();
    List<RelNode> reNamedChildren = Lists.newArrayList();
    RelNode left = prel.getJoinInput(0, children.get(0));
    RelNode right = prel.getJoinInput(leftCount, children.get(1));
    reNamedChildren.add(left);
    reNamedChildren.add(right);
    return (Prel) prel.copy(prel.getTraitSet(), reNamedChildren);
}
Also used : RelNode(org.apache.calcite.rel.RelNode) Prel(org.apache.drill.exec.planner.physical.Prel) JoinPrel(org.apache.drill.exec.planner.physical.JoinPrel)

Aggregations

RelNode (org.apache.calcite.rel.RelNode)1 JoinPrel (org.apache.drill.exec.planner.physical.JoinPrel)1 Prel (org.apache.drill.exec.planner.physical.Prel)1