private void fillGroupResults(VectorizedRowBatch batch, boolean isLastGroupBatch) throws HiveException {
    /*
     * Do careful maintenance of the outputColVector.noNulls flag.
     */
    int evaluatorIndex = -1;
    int startRowIndex = partitionResults.currentRow;

    for (VectorPTFEvaluatorBase evaluator : evaluators) {
      evaluatorIndex += 1;
      if (evaluator.streamsResult()) {
        evaluator.evaluateGroupBatch(batch);
        if (isLastGroupBatch){
          evaluator.doLastBatchWork();
        }
        continue;
      }
      final int outputColumnNum = evaluator.getOutputColumnNum();
      final ColumnVector outputColVector = batch.cols[outputColumnNum];
      partitionResults.currentRow = startRowIndex; //reset row counter before next evaluator
      for (int i = 0; i < batch.size; i++) {
        Object result = partitionResults.getResultForCurrentRow(evaluatorIndex);
        if (result == null) {
          outputColVector.noNulls = false;
          outputColVector.isNull[i] = true;
        } else {
          try{
            switch (evaluator.getResultColumnVectorType()) {
            case LONG:
              ((LongColumnVector) outputColVector).vector[i] =
                  (long) result;
              break;
            case DOUBLE:
              ((DoubleColumnVector) outputColVector).vector[i] =
                  (double) result;
              break;
            case DECIMAL:
              ((DecimalColumnVector) outputColVector).set(i,
                  (HiveDecimalWritable) result);
              break;
            default:
              throw new RuntimeException(
                  "Unexpected column vector type " + evaluator.getResultColumnVectorType());
            }
          } catch (Exception e) {
            throw new RuntimeException(
                String.format("error while setting value from evaluator: %s", evaluator.getClass()),
                e);
          }
        }
        partitionResults.nextRow();
      }
    }
  }
Returns the values of ordering columns from a given batch and given row in an Object[].
@param vectorizedRowBatch
@param rowIndexInBatch
@return
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFGroupBatches.java