private Object getValueFromBatch(VectorizedRowBatch vectorizedRowBatch, int column,
      int rowIndexInBatch) {
    ColumnVector columnVector = vectorizedRowBatch.cols[column];

    if (columnVector.isNull[rowIndexInBatch]
        || (columnVector.isRepeating && columnVector.isNull[0])) {
      return null;
    }
    if (columnVector.isRepeating) {
      rowIndexInBatch = 0;
    }

    switch (columnVector.type) {
    case LONG:
      return ((LongColumnVector) columnVector).vector[rowIndexInBatch];
    case DOUBLE:
      return ((DoubleColumnVector) columnVector).vector[rowIndexInBatch];
    case BYTES:
      // TODO: optimize on bytes, or remove string based windows at all, as it's not supported by
      // SQL standard
      BytesColumnVector inV = (BytesColumnVector) columnVector;
      return new String(inV.vector[rowIndexInBatch], inV.start[rowIndexInBatch],
          inV.length[rowIndexInBatch]);
    case DECIMAL:
      return ((DecimalColumnVector) columnVector).vector[rowIndexInBatch];
    case TIMESTAMP:
      return ((TimestampColumnVector) columnVector).getDouble(rowIndexInBatch);
    case INTERVAL_DAY_TIME:
      return ((IntervalDayTimeColumnVector) columnVector).getTotalSeconds(rowIndexInBatch);
    case STRUCT:
    case LIST:
    case MAP:
    case UNION:
      // No complex type support for now.
    default:
      throw new RuntimeException(
          "Unexpected column vector type while getting value from ordering col: "
              + columnVector.type);
    }
  }
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