com.ebay.erl.mobius.core.function.base
Class SingleInputAggregateFunction

java.lang.Object
  extended by com.ebay.erl.mobius.core.function.base.Projectable
      extended by com.ebay.erl.mobius.core.function.base.GroupFunction
          extended by com.ebay.erl.mobius.core.function.base.AggregateFunction
              extended by 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.
 
Fields inherited from class com.ebay.erl.mobius.core.function.base.AggregateFunction
aggregateResult
 
Fields inherited from class com.ebay.erl.mobius.core.function.base.GroupFunction
rowsToBeOutputted
 
Fields inherited from class com.ebay.erl.mobius.core.function.base.Projectable
conf, hashCode, inputs, outputSchema, reporter, requireDataFromMultiDatasets
 
Constructor Summary
SingleInputAggregateFunction(Column inputColumn)
           
 
Method Summary
protected  Tuple getComputedResult()
          Return the computed result in a Tuple.
 
Methods inherited from class com.ebay.erl.mobius.core.function.base.AggregateFunction
getResult, newBigTupleList, output, reset
 
Methods inherited from class com.ebay.erl.mobius.core.function.base.GroupFunction
consume, getNoMatchResult, getRowsToBeOutputted
 
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
 

Field Detail

inputColumnName

protected java.lang.String inputColumnName
shortcut for the name of the input column.

Constructor Detail

SingleInputAggregateFunction

public SingleInputAggregateFunction(Column inputColumn)
Method Detail

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