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

java.lang.Object
  extended by com.ebay.erl.mobius.core.function.base.Projectable
      extended by com.ebay.erl.mobius.core.function.base.ExtendFunction
All Implemented Interfaces:
java.io.Serializable, org.apache.hadoop.conf.Configurable
Direct Known Subclasses:
Column

public abstract class ExtendFunction
extends Projectable

An extend function takes one row at a time in a group as its input, and produces one row as the output. In other words, the output of ExtendFunction can be decided by just one input row does not require other records in a group. As a result, ExtendFunction cannot to access all the records in a group.

The output of an extended function can be one to many columns. For example, an extended function can be a general function that performs A+B where the value of both A and B columns is numeric and the output of the function is the result of A+B.

The columns provided in the constructor are the inputs to a extend function.

Implement the getResult(Tuple) method to provide the calculation logic.

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 Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ebay.erl.mobius.core.function.base.Projectable
conf, hashCode, inputs, outputSchema, reporter, requireDataFromMultiDatasets
 
Constructor Summary
protected ExtendFunction()
          should be invoked by Column only
  ExtendFunction(Column[] inputs)
           
 
Method Summary
 Tuple getNoMatchResult(java.lang.Object nullReplacement)
          To be called by Mobius, on the case of no match in outer-join task.
abstract  Tuple getResult(Tuple inputRow)
          Get the result of this function based on the inputRow, the schema of the returned Tuple shall be the same as Projectable.getOutputSchema().
 
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
 

Constructor Detail

ExtendFunction

public ExtendFunction(Column[] inputs)

ExtendFunction

protected ExtendFunction()
should be invoked by Column only

Method Detail

getResult

public abstract Tuple getResult(Tuple inputRow)
Get the result of this function based on the inputRow, the schema of the returned Tuple shall be the same as Projectable.getOutputSchema().


getNoMatchResult

public final Tuple getNoMatchResult(java.lang.Object nullReplacement)
To be called by Mobius, on the case of no match in outer-join task.