private Object copyResultIfNeeded(VectorPTFEvaluatorBase evaluator, Object result) {
    if (evaluator.getResultColumnVectorType() == Type.DECIMAL) {
      /*
       * As HiveDecimalWritable is mutable, we need to copy the value before
       * resetting the evaluator, otherwise we'll lose the value. It's easier to take care of it
       * here instead in every single evaluator.
       */
      result = new HiveDecimalWritable((HiveDecimalWritable) result);
    }
    return 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