public static void moveDown(Operator<? extends OperatorDesc> operator) throws SemanticException {

    assert operator.getNumParent() == 1;
    final Operator<? extends OperatorDesc> parent = operator.getParentOperators().get(0);
    final List<Operator<? extends OperatorDesc>> grandParents = parent.getParentOperators();
    parent.removeChildAndAdoptItsChildren(operator);
    for (Operator<? extends OperatorDesc> grandParent : grandParents) {
      grandParent.replaceChild(parent, operator);
    }
    operator.getParentOperators().clear();
    operator.getParentOperators().addAll(grandParents);

    operator.getChildOperators().clear();
    operator.getChildOperators().add(parent);

    parent.getParentOperators().clear();
    parent.getParentOperators().add(operator);
  }
Push through another Top N Key operator.
If the TNK operators are the same one of them will be removed. See {@link TopNKeyDesc#isSame}
else If expression in <code>topnKey</code> is a common prefix in it's parent TNK op and topN property is same
then <code>topnkey</code> could be pushed through parent.
If the Top N Key operator can not be pushed through this method tries to remove one of them:
- if topN property is the same and the keys of one of the operators are subset of the other then the operator
  can be removed
- if the keys are the same operator with higher topN value can be removed
@param topNKey TopNKey operator to push
@throws SemanticException when removeChildAndAdoptItsChildren was not successful
ql/src/java/org/apache/hadoop/hive/ql/optimizer/topnkey/TopNKeyPushdownProcessor.java