private static List<ExprNodeDesc> backtrackAll(List<ExprNodeDesc> exprs, Operator<? extends  OperatorDesc> start,
                                                 Operator<? extends OperatorDesc> terminal) {
    List<ExprNodeDesc> backtrackedExprs = new ArrayList<>();
    try {
      for (ExprNodeDesc expr : exprs) {
        ExprNodeDesc backtrackedExpr = ExprNodeDescUtils.backtrack(expr, start, terminal);
        if(backtrackedExpr == null) {
          return null;
        }
        backtrackedExprs.add(backtrackedExpr);

      }
    } catch (SemanticException e) {
      return null;
    }
    return backtrackedExprs;
  }
Remove operator from the tree, disconnecting it from its
parents and children.
ql/src/java/org/apache/hadoop/hive/ql/exec/OperatorUtils.java