Class Median

  extended by org.apache.pig.EvalFunc<T>
      extended by datafu.pig.util.SimpleEvalFunc<>
          extended by datafu.pig.stats.Quantile
              extended by datafu.pig.stats.Median

public class Median
extends Quantile

Computes the median for a sorted input bag, using type R-2 estimation. This is a convenience wrapper around Quantile.

N.B., all the data is pushed to a single reducer per key, so make sure some partitioning is done (e.g., group by 'day') if the data is too large. That is, this isn't distributed median.

See Also:

Field Summary
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
Constructor Summary
Method Summary
Methods inherited from class datafu.pig.stats.Quantile
call, outputSchema
Methods inherited from class datafu.pig.util.SimpleEvalFunc
exec, getReturnType
Methods inherited from class org.apache.pig.EvalFunc
finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getSchemaName, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Median()

Matthew Hayes, Sam Shah