public class BigIntegerAvg extends EvalFunc<java.math.BigDecimal> implements Algebraic, Accumulator<java.math.BigDecimal>
AVG
.Modifier and Type | Class and Description |
---|---|
static class |
BigIntegerAvg.Final |
static class |
BigIntegerAvg.Initial |
static class |
BigIntegerAvg.Intermediate |
EvalFunc.SchemaType
log, pigLogger, reporter, returnType
Constructor and Description |
---|
BigIntegerAvg() |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(Tuple b)
Pass tuples to the UDF.
|
void |
cleanup()
Called after getValue() to prepare processing for next key.
|
protected static Tuple |
combine(DataBag values) |
protected static java.math.BigInteger |
count(Tuple input) |
protected static java.math.BigDecimal |
div(java.math.BigInteger dividend,
java.math.BigInteger divisor) |
java.math.BigDecimal |
exec(Tuple input)
This callback method must be implemented by all subclasses.
|
java.lang.String |
getFinal()
Get the final function.
|
java.lang.String |
getInitial()
Get the initial function.
|
java.lang.String |
getIntermed()
Get the intermediate function.
|
java.math.BigDecimal |
getValue()
Called when all tuples from current key have been passed to accumulate.
|
Schema |
outputSchema(Schema input)
Report the schema of the output of this UDF.
|
protected static java.math.BigInteger |
sum(Tuple input) |
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public java.math.BigDecimal exec(Tuple input) throws java.io.IOException
EvalFunc
public java.lang.String getInitial()
Algebraic
getInitial
in interface Algebraic
public java.lang.String getIntermed()
Algebraic
getIntermed
in interface Algebraic
public java.lang.String getFinal()
Algebraic
protected static Tuple combine(DataBag values) throws ExecException
ExecException
protected static java.math.BigInteger count(Tuple input) throws ExecException
ExecException
protected static java.math.BigInteger sum(Tuple input) throws ExecException, java.io.IOException
ExecException
java.io.IOException
protected static java.math.BigDecimal div(java.math.BigInteger dividend, java.math.BigInteger divisor)
public Schema outputSchema(Schema input)
EvalFunc
The default implementation interprets the OutputSchema
annotation,
if one is present. Otherwise, it returns null
(no known output schema).
outputSchema
in class EvalFunc<java.math.BigDecimal>
input
- Schema of the inputpublic void accumulate(Tuple b) throws java.io.IOException
Accumulator
accumulate
in interface Accumulator<java.math.BigDecimal>
b
- A tuple containing a single field, which is a bag. The bag will contain the set
of tuples being passed to the UDF in this iteration.java.io.IOException
public void cleanup()
Accumulator
cleanup
in interface Accumulator<java.math.BigDecimal>
public java.math.BigDecimal getValue()
Accumulator
getValue
in interface Accumulator<java.math.BigDecimal>
Copyright © 2007-2012 The Apache Software Foundation