private void getGBYKeyPosFromExpr(ExprNodeDesc expr, List<ExprNodeDesc> groupByKeys,
        List<Integer> gbyKeyPos) {
      for (int i = 0; i < groupByKeys.size(); i++) {
        if (groupByKeys.get(i).isSame(expr)) {
          gbyKeyPos.add(i);
          return;
        }
      }
      if (expr.getChildren() != null) {
        for (int i = 0; i < expr.getChildren().size(); i++) {
          getGBYKeyPosFromExpr(expr.getChildren().get(i), groupByKeys, gbyKeyPos);
        }
      }
    }
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