public static boolean isVarianceNull(long count, VarianceKind varianceKind) {
    switch (varianceKind) {
    case VARIANCE:
    case STANDARD_DEVIATION:
      return (count == 0);
    case VARIANCE_SAMPLE:
    case STANDARD_DEVIATION_SAMPLE:
      return (count <= 1);
    default:
      throw new RuntimeException("Unexpected variance kind " + varianceKind);
    }
  }
Compute the variance. This class is extended by: GenericUDAFVarianceSample
GenericUDAFStd GenericUDAFStdSample
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFVariance.java