use of org.apache.drill.exec.planner.physical.SingleMergeExchangePrel 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;
}
}
Aggregations