public static double calculateVarianceFamilyResult(double variance, long count,
      VarianceKind varianceKind) {
    final double result;
    switch (varianceKind) {
    case VARIANCE:
      result = GenericUDAFVarianceEvaluator.calculateVarianceResult(variance, count);
      break;
    case VARIANCE_SAMPLE:
      result = GenericUDAFVarianceSampleEvaluator.calculateVarianceSampleResult(variance, count);
      break;
    case STANDARD_DEVIATION:
      result = GenericUDAFStdEvaluator.calculateStdResult(variance, count);
      break;
    case STANDARD_DEVIATION_SAMPLE:
      result = GenericUDAFStdSampleEvaluator.calculateStdSampleResult(variance, count);
      break;
    default:
      throw new RuntimeException("Unexpected variance kind " + varianceKind);
    }
    return result;
  }
Compute the variance. This class is extended by: GenericUDAFVarianceSample
GenericUDAFStd GenericUDAFStdSample
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFVariance.java