|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pig.EvalFunc<T>
org.apache.pig.builtin.AlgebraicBigDecimalMathBase
public abstract class AlgebraicBigDecimalMathBase
Core logic for applying an SUM function to a bag of BigDecimals. This is a modified version of AlgebraicDoubleMathBase
| Nested Class Summary | |
|---|---|
static class |
AlgebraicBigDecimalMathBase.Final
|
static class |
AlgebraicBigDecimalMathBase.Intermediate
|
static class |
AlgebraicMathBase.Initial
|
protected static class |
AlgebraicMathBase.KNOWN_OP
|
protected static interface |
AlgebraicMathBase.KnownOpProvider
|
| Nested classes/interfaces inherited from class org.apache.pig.EvalFunc |
|---|
EvalFunc.SchemaType |
| Field Summary | |
|---|---|
protected AlgebraicMathBase.KnownOpProvider |
opProvider
|
| Fields inherited from class org.apache.pig.EvalFunc |
|---|
log, pigLogger, reporter, returnType |
| Constructor Summary | |
|---|---|
AlgebraicBigDecimalMathBase()
|
|
| Method Summary | |
|---|---|
void |
accumulate(Tuple b)
Pass tuples to the UDF. |
void |
cleanup()
Called after getValue() to prepare processing for next key. |
protected static BigDecimal |
doTupleWork(Tuple input,
AlgebraicMathBase.KnownOpProvider opProvider)
|
BigDecimal |
exec(Tuple input)
This callback method must be implemented by all subclasses. |
String |
getFinal()
Get the final function. |
String |
getInitial()
Get the initial function. |
String |
getIntermed()
Get the intermediate function. |
protected static BigDecimal |
getSeed(AlgebraicMathBase.KNOWN_OP op)
|
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 void |
setOp(AlgebraicMathBase.KNOWN_OP op)
|
| Methods inherited from class org.apache.pig.EvalFunc |
|---|
finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, 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 |
| Field Detail |
|---|
protected AlgebraicMathBase.KnownOpProvider opProvider
| Constructor Detail |
|---|
public AlgebraicBigDecimalMathBase()
| Method Detail |
|---|
protected static BigDecimal getSeed(AlgebraicMathBase.KNOWN_OP op)
protected static BigDecimal doTupleWork(Tuple input,
AlgebraicMathBase.KnownOpProvider opProvider)
throws ExecException
ExecException
public BigDecimal exec(Tuple input)
throws IOException
EvalFunc
exec in class EvalFunc<BigDecimal>input - the Tuple to be processed.
IOExceptionpublic 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<BigDecimal>input - Schema of the input
public void accumulate(Tuple b)
throws IOException
Accumulator
accumulate in interface Accumulator<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.
IOExceptionpublic void cleanup()
Accumulator
cleanup in interface Accumulator<BigDecimal>public BigDecimal getValue()
Accumulator
getValue in interface Accumulator<BigDecimal>protected void setOp(AlgebraicMathBase.KNOWN_OP op)
public String getInitial()
Algebraic
getInitial in interface Algebraicpublic String getIntermed()
Algebraic
getIntermed in interface Algebraicpublic String getFinal()
Algebraic
getFinal in interface Algebraic
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||