public static Operator<?> removeBranch(Operator<?> event) {
    Operator<?> child = event;
    Operator<?> curr = event;

    while (curr.getChildOperators().size() <= 1) {
      child = curr;
      curr = curr.getParentOperators().get(0);
    }

    curr.removeChild(child);

    return child;
  }
Remove an operator branch. When we see a fork, we know it's time to do the removal.
@param event the leaf node of which branch to be removed
ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java