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

    evaluateInputExpr(batch);

    // Count non-null column rows.

    // We do not filter when PTF is in reducer.
    Preconditions.checkState(!batch.selectedInUse);

    final int size = batch.size;
    if (size == 0) {
      return;
    }
    ColumnVector colVector = batch.cols[inputColumnNum];
    if (colVector.isRepeating) {
      if (colVector.noNulls || !colVector.isNull[0]) {
        count += size;
      }
    } else if (colVector.noNulls) {
      count += size;
    } else {
      boolean[] batchIsNull = colVector.isNull;
      int i = 0;
      while (batchIsNull[i]) {
        if (++i >= size) {
          return;
        }
      }
      long varCount = 1;
      i++;
      for (; i < size; i++) {
        if (!batchIsNull[i]) {
          varCount++;
        }
      }
      count += varCount;
    }
  }
This class evaluates count(column) for a PTF group.

Count any rows of the group where the input column/expression is non-null.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFEvaluatorCount.java