Search in sources :

Example 1 with HashToMergeExchangePrel

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

the class ExcessiveExchangeIdentifier method visitExchange.

@Override
public Prel visitExchange(ExchangePrel prel, MajorFragmentStat parent) throws RuntimeException {
    parent.add(prel);
    MajorFragmentStat newFrag = new MajorFragmentStat();
    newFrag.setRightSideOfLateral(parent.isRightSideOfLateral());
    if (prel instanceof SingleMergeExchangePrel) {
        newFrag.isSimpleRel = true;
    }
    Prel newChild = ((Prel) prel.getInput()).accept(this, newFrag);
    if (parent.isSimpleRel && prel instanceof HashToMergeExchangePrel) {
        return newChild;
    }
    if (canRemoveExchange(parent, newFrag)) {
        return newChild;
    } else if (newChild != prel.getInput()) {
        return (Prel) prel.copy(prel.getTraitSet(), Collections.singletonList(newChild));
    } else {
        return prel;
    }
}
Also used : SingleMergeExchangePrel(org.apache.drill.exec.planner.physical.SingleMergeExchangePrel) HashToMergeExchangePrel(org.apache.drill.exec.planner.physical.HashToMergeExchangePrel) LateralJoinPrel(org.apache.drill.exec.planner.physical.LateralJoinPrel) ExchangePrel(org.apache.drill.exec.planner.physical.ExchangePrel) ScanPrel(org.apache.drill.exec.planner.physical.ScanPrel) Prel(org.apache.drill.exec.planner.physical.Prel) SingleMergeExchangePrel(org.apache.drill.exec.planner.physical.SingleMergeExchangePrel) ProjectPrel(org.apache.drill.exec.planner.physical.ProjectPrel) ScreenPrel(org.apache.drill.exec.planner.physical.ScreenPrel) FilterPrel(org.apache.drill.exec.planner.physical.FilterPrel) UnnestPrel(org.apache.drill.exec.planner.physical.UnnestPrel) LimitPrel(org.apache.drill.exec.planner.physical.LimitPrel) HashToMergeExchangePrel(org.apache.drill.exec.planner.physical.HashToMergeExchangePrel)

Aggregations

ExchangePrel (org.apache.drill.exec.planner.physical.ExchangePrel)1 FilterPrel (org.apache.drill.exec.planner.physical.FilterPrel)1 HashToMergeExchangePrel (org.apache.drill.exec.planner.physical.HashToMergeExchangePrel)1 LateralJoinPrel (org.apache.drill.exec.planner.physical.LateralJoinPrel)1 LimitPrel (org.apache.drill.exec.planner.physical.LimitPrel)1 Prel (org.apache.drill.exec.planner.physical.Prel)1 ProjectPrel (org.apache.drill.exec.planner.physical.ProjectPrel)1 ScanPrel (org.apache.drill.exec.planner.physical.ScanPrel)1 ScreenPrel (org.apache.drill.exec.planner.physical.ScreenPrel)1 SingleMergeExchangePrel (org.apache.drill.exec.planner.physical.SingleMergeExchangePrel)1 UnnestPrel (org.apache.drill.exec.planner.physical.UnnestPrel)1