FakeVectorRowBatchFromObjectIterables getDataForRollup() throws HiveException {
    // k1 has nDV of 2
    Iterable<Object> k1 = new Iterable<Object>() {
      @Override
      public Iterator<Object> iterator() {
        return new Iterator<Object>() {
          int value = 0;
          int ndv = 2;

          @Override
          public boolean hasNext() {
            return true;
          }

          @Override
          public Object next() {
            value = (value + 1) % ndv;
            return value;
          }

          @Override
          public void remove() {
          }
        };
      }
    };

    // ndv of 5
    Iterable<Object> k2 = new Iterable<Object>() {
      @Override
      public Iterator<Object> iterator() {
        return new Iterator<Object>() {
          int value = 0;
          int ndv = 6;

          @Override
          public boolean hasNext() {
            return true;
          }

          @Override
          public Object next() {
            value = (value + 1) % ndv;
            return value;
          }

          @Override
          public void remove() {
          }
        };
      }
    };

    // just return 1, we're running "count"
    Iterable<Object> v = new Iterable<Object>() {
      @Override
      public Iterator<Object> iterator() {
        return new Iterator<Object>() {
          int value = 0;
          int ndv = 1;

          @Override
          public boolean hasNext() {
            return true;
          }

          @Override
          public Object next() {
            value = (value + 1) % ndv;
            return value;
          }

          @Override
          public void remove() {
          }
        };
      }
    };

    // vrb of 1 row each
    return new FakeVectorRowBatchFromObjectIterables(
        2,
        new String[] {"long", "long", "long", "long"},
        k1,
        k2,
        v,
        v); // output col
  }
Unit test for the vectorized GROUP BY operator.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorGroupByOperator.java