public static ExprNodeDesc replaceTabAlias(ExprNodeDesc expr, String oldAlias, String newAlias) {
    if (expr == null) {
      return null;
    }
    if (expr.getChildren() != null) {
      for (ExprNodeDesc c : expr.getChildren()) {
        replaceTabAlias(c, oldAlias, newAlias);
      }
    }
    if (expr instanceof ExprNodeColumnDesc) {
      ExprNodeColumnDesc exprNodeColumnDesc = (ExprNodeColumnDesc) expr;
      if (exprNodeColumnDesc.getTabAlias() != null && exprNodeColumnDesc.getTabAlias().equals(oldAlias)) {
        exprNodeColumnDesc.setTabAlias(newAlias);
      }
    }
    return expr;
  }
Checks wether the two expression sets have a common deterministic intersection.
ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDescUtils.java