protected static boolean isExisted(ExprNodeDesc expr, List<ExprNodeDesc> columns) {
    for (ExprNodeDesc thisExpr : columns) {
      if (thisExpr != null && thisExpr.isSame(expr)) {
        return true;
      }
    }
    return false;
  }
Utilities for both CorrelationOptimizer and ReduceSinkDeDuplication.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/CorrelationUtilities.java