private boolean isPartitionChanged(VectorizedRowBatch batch) {

    final int count = partitionColumnMap.length;
    for (int i = 0; i < count; i++) {
      ColumnVector colVector = batch.cols[partitionColumnMap[i]];

      // Vector reduce key (i.e. partition) columns are repeated -- so we test element 0.

      final boolean isNull = !colVector.noNulls && colVector.isNull[0];
      final boolean currentIsNull = currentPartitionIsNull[i];

      if (isNull != currentIsNull) {
        return true;
      }
      if (isNull) {
        // NULL does equal NULL here.
        continue;
      }

      switch (partitionColumnVectorTypes[i]) {
      case LONG:
        if (currentPartitionLongs[i] != ((LongColumnVector) colVector).vector[0]) {
          return true;
        }
        break;
      case DOUBLE:
        if (currentPartitionDoubles[i] != ((DoubleColumnVector) colVector).vector[0]) {
          return true;
        }
        break;
      case BYTES:
        {
          BytesColumnVector byteColVector = (BytesColumnVector) colVector;
          byte[] bytes = byteColVector.vector[0];
          final int start = byteColVector.start[0];
          final int length = byteColVector.length[0];
          if (!StringExpr.equal(
              bytes, start, length,
              currentPartitionByteArrays[i], 0, currentPartitionByteLengths[i])) {
            return true;
          }
        }
        break;
      case DECIMAL:
        if (!currentPartitionDecimals[i].equals(((DecimalColumnVector) colVector).vector[0])) {
          return true;
        }
        break;
      case TIMESTAMP:
        if (((TimestampColumnVector) colVector).compareTo(0, currentPartitionTimestamps[i]) != 0) {
          return true;
        }
        break;
      case INTERVAL_DAY_TIME:
        if (((IntervalDayTimeColumnVector) colVector).compareTo(0, currentPartitionIntervalDayTimes[i]) != 0) {
          return true;
        }
        break;
      default:
        throw new RuntimeException("Unexpected column vector type " + partitionColumnVectorTypes[i]);
      }
    }
    return false;
  }
Let's say we have a typical ordering scenario where is 1 order column:
keyInputColumnMap: [0, 1] (-> key cols contain order cols)
orderColumnMap: [1]
The method returns the non-ordering key columns: [0]

This is typically needed when while forwarding batches and want to fill
only partitioning but non-ordering columns from buffered batches to the overflow batch,
as the buffered batches already contain ordering column which is used for range calculation.

Possible scenarios:
1. explicit partitioning and ordering column
select p_mfgr, p_name, p_retailprice, count(*) over(partition by p_mfgr order by p_date)
keyInputColumnMap: [0, 1]
orderColumnMap: [1]

2a. no explicit ordering col
select p_mfgr, p_name, p_retailprice, count(*) over(partition by p_mfgr)
keyInputColumnMap: [0]
orderColumnMap: [0]

2b. no explicit ordering col, another column (keyInput is 0th again)
select p_mfgr, p_name, p_retailprice, count(*) over(partition by p_name)
keyInputColumnMap: [0]
orderColumnMap: [0]

3. no explicit partitioning col (= constant partition expression)
select p_mfgr, p_name, p_retailprice, count(*) over(order by p_date)
keyInputColumnMap: [1]
orderColumnMap: [1]

4. constant present on the partitioning column
select p_mfgr, p_name, p_retailprice, count(*) over(partition by p_mfgr)
from vector_ptf_part_simple_orc where p_mfgr = "Manufacturer#1";
partitionExpressions: [ConstantVectorExpression(val Manufacturer#1) -> 6:string]
orderExpressions: [ConstantVectorExpression(val Manufacturer#1) -> 7:string]
keyInputColumnMap: []
orderColumnMap: [7]
@param keyInputColumnMap
@param orderColumnMap
@return
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFOperator.java