Search in sources :

Example 1 with UnionPrel

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

the class FinalColumnReorderer method visitPrel.

@Override
public Prel visitPrel(Prel prel, Void value) throws RuntimeException {
    if (prel instanceof UnionPrel) {
        return addColumnOrderingBelowUnion(prel);
    }
    List<RelNode> children = Lists.newArrayList();
    boolean changed = false;
    for (Prel p : prel) {
        Prel newP = p.accept(this, null);
        if (newP != p) {
            changed = true;
        }
        children.add(newP);
    }
    if (changed) {
        return (Prel) prel.copy(prel.getTraitSet(), children);
    } else {
        return prel;
    }
}
Also used : RelNode(org.apache.calcite.rel.RelNode) UnionPrel(org.apache.drill.exec.planner.physical.UnionPrel) UnionPrel(org.apache.drill.exec.planner.physical.UnionPrel) Prel(org.apache.drill.exec.planner.physical.Prel) ProjectPrel(org.apache.drill.exec.planner.physical.ProjectPrel) ScreenPrel(org.apache.drill.exec.planner.physical.ScreenPrel) WriterPrel(org.apache.drill.exec.planner.physical.WriterPrel)

Aggregations

RelNode (org.apache.calcite.rel.RelNode)1 Prel (org.apache.drill.exec.planner.physical.Prel)1 ProjectPrel (org.apache.drill.exec.planner.physical.ProjectPrel)1 ScreenPrel (org.apache.drill.exec.planner.physical.ScreenPrel)1 UnionPrel (org.apache.drill.exec.planner.physical.UnionPrel)1 WriterPrel (org.apache.drill.exec.planner.physical.WriterPrel)1