private static Pair<GroupByDesc,VectorGroupByDesc> buildGroupByDescCountStar(
      VectorizationContext ctx) {

    AggregationDesc agg = buildAggregationDescCountStar(ctx);
    ArrayList<AggregationDesc> aggs = new ArrayList<AggregationDesc>();
    aggs.add(agg);

    ArrayList<String> outputColumnNames = new ArrayList<String>();
    outputColumnNames.add("_col0");

    GroupByDesc desc = new GroupByDesc();
    VectorGroupByDesc vectorDesc = new VectorGroupByDesc();
    vectorDesc.setVecAggrDescs(
        new VectorAggregationDesc[] {
            new VectorAggregationDesc.VectorAggregationDescBuilder()
                .aggregationName(agg.getGenericUDAFName())
                .evaluator(new GenericUDAFCount.GenericUDAFCountEvaluator())
                .udafEvaluatorMode(agg.getMode())
                .inputColVectorType(ColumnVector.Type.NONE)
                .outputTypeInfo(TypeInfoFactory.longTypeInfo)
                .outputColVectorType(ColumnVector.Type.LONG)
                .vectorAggregationClass(VectorUDAFCountStar.class)
                .build()});
    vectorDesc.setProcessingMode(VectorGroupByDesc.ProcessingMode.HASH);

    desc.setOutputColumnNames(outputColumnNames);
    desc.setAggregators(aggs);

    return new Pair<GroupByDesc,VectorGroupByDesc>(desc, vectorDesc);
  }
Unit test for the vectorized GROUP BY operator.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorGroupByOperator.java