@Override
  public void process(Object row, int tag) throws HiveException {
    VectorizedRowBatch batch = (VectorizedRowBatch) row;

    for (VectorExpression orderExpression : orderExpressions) {
      orderExpression.evaluate(batch);
    }

    if (partitionExpressions != null) {
      for (VectorExpression partitionExpression : partitionExpressions) {
        partitionExpression.evaluate(batch);
      }
    }

    if (isFirstPartition) {
      isFirstPartition = false;
      setCurrentPartition(batch);
    } else if (isPartitionChanged(batch)) {
      /*
       * We should take care of evaluating the previous partition, but only if not all the
       * evaluators are streaming. If they are all streaming, are supposed to put their results into
       * the column vectors on the fly (in a streaming manner), this is handled later on by calling
       * groupBatches.evaluateStreamingGroupBatch for every single batch.
       */
      if (!allEvaluatorsAreStreaming){
        finishPartition(getPartitionKey());
      }
      setCurrentPartition(batch);
      groupBatches.resetEvaluators();
    }

    if (allEvaluatorsAreStreaming) {
      // We can process this batch immediately.
      groupBatches.evaluateStreamingGroupBatch(batch, isLastGroupBatch);
      forward(batch, null);
    } else {
      // only collecting the batch for later evaluation
      groupBatches.bufferGroupBatch(batch, isLastGroupBatch);
    }

    // If we are only processing a PARTITION BY and isLastGroupBatch, reset our evaluators.
    if (!isPartitionOrderBy && isLastGroupBatch) {
      groupBatches.resetEvaluators();
    }
  }
We are processing a batch from reduce processor that is only for one reducer key or PTF group.

For a simple OVER (PARTITION BY column) or OVER (ORDER BY column), the reduce processor's
group key is the partition or order by key.

For an OVER (PARTITION BY column1, ORDER BY column2), the reduce-shuffle group key is
the combination of the partition column1 and the order by column2.  In this case, this method
has to watch for changes in the partition and reset the group aggregations.

The reduce processor calls setNextVectorBatchGroupStatus beforehand to tell us whether the
batch supplied to our process method is the last batch for the group key, or not.  This helps
us intelligently process the batch.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFOperator.java