public class GenericUDAFVariance extends AbstractGenericUDAFResolver
Modifier and Type | Class and Description |
---|---|
static class |
GenericUDAFVariance.GenericUDAFVarianceEvaluator
Evaluate the variance using the algorithm described by Chan, Golub, and LeVeque in
"Algorithms for computing the sample variance: analysis and recommendations"
The American Statistician, 37 (1983) pp.
|
static class |
GenericUDAFVariance.VarianceKind |
Constructor and Description |
---|
GenericUDAFVariance() |
Modifier and Type | Method and Description |
---|---|
static double |
calculateIntermediate(long count,
double sum,
double value,
double variance) |
static double |
calculateMerge(long partialCount,
long mergeCount,
double partialSum,
double mergeSum,
double partialVariance,
double mergeVariance) |
static double |
calculateVarianceFamilyResult(double variance,
long count,
GenericUDAFVariance.VarianceKind varianceKind) |
GenericUDAFEvaluator |
getEvaluator(TypeInfo[] parameters)
Get the evaluator for the parameter types.
|
static boolean |
isVarianceFamilyName(String name) |
static boolean |
isVarianceNull(long count,
GenericUDAFVariance.VarianceKind varianceKind) |
getEvaluator
public static boolean isVarianceFamilyName(String name)
public static boolean isVarianceNull(long count, GenericUDAFVariance.VarianceKind varianceKind)
public static double calculateIntermediate(long count, double sum, double value, double variance)
public static double calculateMerge(long partialCount, long mergeCount, double partialSum, double mergeSum, double partialVariance, double mergeVariance)
public static double calculateVarianceFamilyResult(double variance, long count, GenericUDAFVariance.VarianceKind varianceKind)
public GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters) throws SemanticException
GenericUDAFResolver
If the class of the object does not implement Serializable, then we will create a new instance of the class at execution time.
getEvaluator
in interface GenericUDAFResolver
getEvaluator
in class AbstractGenericUDAFResolver
parameters
- The types of the parameters. We need the type information to know
which evaluator class to use.SemanticException
Copyright © 2019 The Apache Software Foundation. All rights reserved.