@Override
  public void evaluateGroupBatch(VectorizedRowBatch batch)
      throws HiveException {

    evaluateInputExpr(batch);

    final int size = batch.size;
    LongColumnVector longColVector = (LongColumnVector) batch.cols[outputColumnNum];
    long[] vector = longColVector.vector;
    for (int i = 0; i < size; i++) {
      vector[i] = rowNumber++;
    }
  }
This class evaluates row_number() for a PTF group.

Row number starts at 1; stream row number to output column for each row and increment.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFEvaluatorRowNumber.java