private void runEvaluatorForRow(int evaluatorIndex, VectorPTFEvaluatorBase evaluator,
      int rowNum, Range range) throws HiveException {
    if (valueCache != null && evaluator.isCacheableForRange()) {
      Object cacheValue = valueCache.get(evaluatorIndex, range);
      if (cacheValue != null) {
        partitionResults.addResult(evaluatorIndex, rowNum, cacheValue);
        return;
      }
    }

    Object result = null;
    if (evaluator.canRunOptimizedCalculation(rowNum, range)) {
      result = copyResultIfNeeded(evaluator, evaluator.runOnRange(rowNum, range, this));
      partitionMetrics.evaluationOptimized += 1;
    } else { // fallback to batch-by-batch manner over the whole range
      result = runEvaluatorOnRange(evaluator, range, false);
      partitionMetrics.evaluationSimple += 1;
    }
    evaluator.onResultCalculated(result, range);
    evaluator.resetEvaluator();
    partitionResults.addResult(evaluatorIndex, rowNum, result);

    if (valueCache != null && evaluator.isCacheableForRange()) {
      valueCache.put(evaluatorIndex, range, result);
    }
  }
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