use of com.actiontech.dble.plan.node.MergeNode in project dble by actiontech.
the class LimitPusher method findChild.
private static PlanNode findChild(PlanNode qtn) {
if (qtn instanceof MergeNode) {
// optimizer limit
// union: push down limit to children
// union all:push down limit to children and add distinct
MergeNode node = (MergeNode) qtn;
long limitFrom = node.getLimitFrom();
long limitTo = node.getLimitTo();
if (limitFrom != -1 && limitTo != -1) {
for (PlanNode child : node.getChildren()) {
pushLimit(child, limitFrom, limitTo, node.isUnion());
}
}
} else if ((qtn instanceof JoinNode) || (qtn instanceof QueryNode)) {
for (PlanNode child : qtn.getChildren()) {
findChild(child);
}
}
return qtn;
}