protected void convertGroupByMapSideSortedGroupBy(
        HiveConf conf, GroupByOperator groupByOp, int depth) {
      pGraphContext.getQueryProperties().setHasMapGroupBy(true);

      if (removeChildren(groupByOp, depth)) {
        // Use bucketized hive input format - that makes sure that one mapper reads the entire file
        groupByOp.setUseBucketizedHiveInputFormat(true);
        groupByOp.getConf().setMode(GroupByDesc.Mode.FINAL);
      }
    }
Given the group by keys, bucket columns and sort columns, this method
determines if we can use sorted group by or not.

@param groupByCols
@param bucketCols
@param sortCols
@return
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GroupByOptimizer.java