if (current.getParentCount() == 0) {
return child;
} else {
assert(current.getParentCount() == 1);
AbstractPlanNode parent = current.getParent(0);
parent.unlinkChild(current);
parent.addAndLinkChild(child);
return root;
}
} else if (current.getChildCount() == 1) {
// This is still a coordinator node