private void createNewGroupingKey(List<ExprNodeDesc> groupByKeys,
                                    List<String> outputColumnNames,
                                    RowResolver groupByOutputRowResolver,
                                    Map<String, ExprNodeDesc> colExprMap) {
    // The value for the constant does not matter. It is replaced by the grouping set
    // value for the actual implementation
    ExprNodeConstantDesc constant = new ExprNodeConstantDesc(VirtualColumn.GROUPINGID.getTypeInfo(), 0L);
    groupByKeys.add(constant);
    String field = getColumnInternalName(groupByKeys.size() - 1);
    outputColumnNames.add(field);
    groupByOutputRowResolver.put(null, VirtualColumn.GROUPINGID.getName(),
        new ColumnInfo(
            field,
            VirtualColumn.GROUPINGID.getTypeInfo(),
            null,
            true));
    colExprMap.put(field, constant);
  }
Generate the GroupByOperator for the Query Block (parseInfo.getXXX(dest)).
The new GroupByOperator will be a child of the reduceSinkOperatorInfo.

@param parseInfo
@param dest
@param reduceSinkOperatorInfo
@param mode
         The mode of the aggregation (MERGEPARTIAL, PARTIAL2)
@param genericUDAFEvaluators
         The mapping from Aggregation StringTree to the
         genericUDAFEvaluator.
@param groupingSets
         list of grouping sets
@param groupingSetsPresent
         whether grouping sets are present in this query
@param groupingSetsNeedAdditionalMRJob
         whether grouping sets are consumed by this group by
@return the new GroupByOperator
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java