void init(VectorExpression[] keyExpressions) throws HiveException {

    // NOTE: To support pruning the grouping set id dummy key by VectorGroupByOperator MERGE_PARTIAL
    // case, we use the keyCount passed to the constructor and not keyExpressions.length.

    // Inspect the output type of each key expression.  And, remember the output columns.
    inputColumnNums = new int[keyCount];
    for(int i = 0; i < keyCount; ++i) {
      VectorExpression keyExpression = keyExpressions[i];

      TypeInfo typeInfo = keyExpression.getOutputTypeInfo();
      addKey(typeInfo);

      // The output of the key expression is the input column.
      final int inputColumnNum = keyExpression.getOutputColumnNum();

      inputColumnNums[i] = inputColumnNum;
    }
    finishAdding();
  }
Class for copying the group key from an input batch to an output batch.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupKeyHelper.java