com.ebay.erl.mobius.core.function.base
Class SingleInputAggregateFunction
java.lang.Object
com.ebay.erl.mobius.core.function.base.Projectable
com.ebay.erl.mobius.core.function.base.GroupFunction
com.ebay.erl.mobius.core.function.base.AggregateFunction
com.ebay.erl.mobius.core.function.base.SingleInputAggregateFunction
- All Implemented Interfaces:
- java.io.Serializable, org.apache.hadoop.conf.Configurable
- Direct Known Subclasses:
- Avg, Counts, Max, Medium, Min, Sum
public abstract class SingleInputAggregateFunction
- extends AggregateFunction
A single input aggregate function is a special type of
aggregate function. It takes single column from a
dataset as its input and consumes all the records in a
group to generate a single row as its output.
This class enforces the limit of one column to the
constructor.
This product is licensed under the Apache License, Version 2.0,
available at http://www.apache.org/licenses/LICENSE-2.0.
This product contains portions derived from Apache hadoop which is
licensed under the Apache License, Version 2.0, available at
http://hadoop.apache.org.
© 2007 – 2012 eBay Inc., Evan Chiu, Woody Zhou, Neel Sundaresan
See getComputedResult()
about the output of SingleInputAggregateFunction
.
- See Also:
- Serialized Form
Field Summary |
protected java.lang.String |
inputColumnName
shortcut for the name of the input column. |
Methods inherited from class com.ebay.erl.mobius.core.function.base.Projectable |
calledByCombiner, equals, getConf, getInputColumns, getOutputSchema, getParticipatedDataset, hashCode, init, isCombinable, requireDataFromMultiDatasets, setCalledByCombiner, setConf, setOutputSchema, setReporter, toString, useGroupKeyOnly |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
inputColumnName
protected java.lang.String inputColumnName
- shortcut for the name of the input column.
SingleInputAggregateFunction
public SingleInputAggregateFunction(Column inputColumn)
getComputedResult
protected Tuple getComputedResult()
- Return the computed result in a
Tuple
.
By default, the returned Tuple
contains only
one column, the name of the column is the first
element in the Projectable.getOutputSchema()
.
Override this method if there is a need to output a
Tuple
with more than one column.
- Specified by:
getComputedResult
in class AggregateFunction