private ExprNodeDesc replaceColumnExprNodes(ExprNodeDesc exprNodeDesc, Map<ExprNodeDesc, ExprNodeDesc> replaceMap) {
      if (exprNodeDesc instanceof ExprNodeColumnDesc) {
        return replaceMap.getOrDefault(exprNodeDesc, exprNodeDesc);
      }
      if (exprNodeDesc instanceof ExprNodeGenericFuncDesc) {
        ExprNodeGenericFuncDesc exprNodeGenericFuncDesc = (ExprNodeGenericFuncDesc) exprNodeDesc.clone();
        List<ExprNodeDesc> replacedChildren = new ArrayList<>(exprNodeDesc.getChildren().size());
        for (ExprNodeDesc child : exprNodeDesc.getChildren()) {
          replacedChildren.add(replaceColumnExprNodes(child, replaceMap));
        }
        exprNodeGenericFuncDesc.setChildren(replacedChildren);
        return exprNodeGenericFuncDesc;
      }

      return exprNodeDesc;
    }
Replaces exprNodeDescs in the specified exprNodeDesc using replaceMap by traversing the expression tree.
@param exprNodeDesc expression where exprNodeDescs should be replaced.
@param replaceMap Map containing replacements: key exprNodeDesc should be replaced to value exprNodeDesc.
@return The new expression with replaced exprNodeDescs.
ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java