public void finishPartition() throws HiveException {
    long startTime = System.currentTimeMillis();
    preFinishPartition();
    int evaluatorIndex = 0;
    /*
     * This could become a very heavy loop, which runs for all rows in the partition
     * and calculates the aggregated value on the defined range relative to the actual row,
     * so if:
     * rows = 10000
     * evaluators = 5
     * avg range size: 100
     *
     * The following cost and optimizations should be considered:
     * 1. getRange calculation with n^2 complexity as described on HIVE-21217 (BoundaryCache)
     * 2. runEvaluator method will calculate ~ 10000 * 5 * 100 = 5000000 values (PTFValueCache)
     */
    for (int rowNum = 0; rowNum < size(); rowNum++) {
      evaluatorIndex = 0;

      for (VectorPTFEvaluatorBase evaluator : evaluators) {
        // calculate and store non-streaming results here
        // streaming evaluators are evaluated on-the-fly in fillGroupResults
        if (!evaluator.streamsResult()) {
          Range range = PTFRangeUtil.getRange(evaluator.windowFrameDef, rowNum, this,
              evaluator.getNullsLast());
          runEvaluatorForRow(evaluatorIndex, evaluator, rowNum, range);
        }
        evaluatorIndex += 1;
      }
    }
    partitionMetrics.setDuration(System.currentTimeMillis() - startTime);
    LOG.info("Finished evaluation of partition, metrics: {}", partitionMetrics);
    if (valueCache != null && valueCache.getStatistics() != null) {
      LOG.info(valueCache.getStatistics());
    }
  }
Overrides PTFPartition.size(), this is supposed to return the amount of records in the partition.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFGroupBatches.java