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

    evaluateInputExpr(batch);

    // Determine minimum of all non-null double column values; maintain isGroupResultNull.

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

    final int size = batch.size;
    if (size == 0) {
      return;
    }
    DoubleColumnVector doubleColVector = ((DoubleColumnVector) batch.cols[inputColumnNum]);
    if (doubleColVector.isRepeating) {

      if (doubleColVector.noNulls || !doubleColVector.isNull[0]) {
        if (isGroupResultNull) {
          min = doubleColVector.vector[0];
          isGroupResultNull = false;
        } else {
          final double repeatedMin = doubleColVector.vector[0];
          if (repeatedMin < min) {
            min = repeatedMin;
          }
        }
      }
    } else if (doubleColVector.noNulls) {
      double[] vector = doubleColVector.vector;
      double varMin = vector[0];
      for (int i = 1; i < size; i++) {
        final double d = vector[i];
        if (d < varMin) {
          varMin = d;
        }
      }
      if (isGroupResultNull) {
        min = varMin;
        isGroupResultNull = false;
      } else if (varMin < min) {
        min = varMin;
      }
    } else {
      boolean[] batchIsNull = doubleColVector.isNull;
      int i = 0;
      while (batchIsNull[i]) {
        if (++i >= size) {
          return;
        }
      }
      double[] vector = doubleColVector.vector;
      double varMin = vector[i++];
      for (; i < size; i++) {
        if (!batchIsNull[i]) {
          final double d = vector[i];
          if (d < varMin) {
            varMin = d;
          }
        }
      }
      if (isGroupResultNull) {
        min = varMin;
        isGroupResultNull = false;
      } else if (varMin < min) {
        min = varMin;
      }
    }
  }
This class evaluates double min() for a PTF group.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFEvaluatorDoubleMin.java