org.apache.pig.scripting.jruby
Class JrubyAlgebraicEvalFunc<T>
java.lang.Object
org.apache.pig.EvalFunc<T>
org.apache.pig.AccumulatorEvalFunc<T>
org.apache.pig.AlgebraicEvalFunc<T>
org.apache.pig.scripting.jruby.JrubyAlgebraicEvalFunc<T>
- All Implemented Interfaces:
- Accumulator<T>, Algebraic
- Direct Known Subclasses:
- JrubyAlgebraicEvalFunc.BagJrubyAlgebraicEvalFunc, JrubyAlgebraicEvalFunc.ChararrayJrubyAlgebraicEvalFunc, JrubyAlgebraicEvalFunc.DataByteArrayJrubyAlgebraicEvalFunc, JrubyAlgebraicEvalFunc.DoubleJrubyAlgebraicEvalFunc, JrubyAlgebraicEvalFunc.FloatJrubyAlgebraicEvalFunc, JrubyAlgebraicEvalFunc.IntegerJrubyAlgebraicEvalFunc, JrubyAlgebraicEvalFunc.LongJrubyAlgebraicEvalFunc, JrubyAlgebraicEvalFunc.MapJrubyAlgebraicEvalFunc, JrubyAlgebraicEvalFunc.TupleJrubyAlgebraicEvalFunc
public abstract class JrubyAlgebraicEvalFunc<T>
- extends AlgebraicEvalFunc<T>
This class provides the bridge between Ruby classes that extend the AlgebraicPigUdf
"interface" by implementing an initial, intermed, and final method. Unlike EvalFuncs
and Accumulators, the type must be known at compile time (ie it can't return Object),
as Pig inspects the type and ensures that it is valid. This is why class specific
shells are provided at the bottom. This class leverages AlgebraicEvalFunc to provide
the Accumulator and EvalFunc implementations.
Constructor Summary |
JrubyAlgebraicEvalFunc(String fileName,
String functionName)
The constructor takes information on the script and method being invoked and registers it with the
superclass (which is necessary for AlgebraicEvalFunc). |
Method Summary |
abstract String |
getFinal()
This must be implement as per a normal Algebraic interface. |
String |
getInitial()
This must be implement as per a normal Algebraic interface. |
String |
getIntermed()
This must be implement as per a normal Algebraic interface. |
Methods inherited from class org.apache.pig.EvalFunc |
finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, isAsynchronous, outputSchema, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mBagFactory
protected static BagFactory mBagFactory
mTupleFactory
protected static final TupleFactory mTupleFactory
rubyEngine
protected static final org.jruby.embed.ScriptingContainer rubyEngine
ruby
protected static final org.jruby.Ruby ruby
JrubyAlgebraicEvalFunc
public JrubyAlgebraicEvalFunc(String fileName,
String functionName)
- The constructor takes information on the script and method being invoked and registers it with the
superclass (which is necessary for AlgebraicEvalFunc).
getFinal
public abstract String getFinal()
- Description copied from class:
AlgebraicEvalFunc
- This must be implement as per a normal Algebraic interface. See
Algebraic
for
more information.
- Specified by:
getFinal
in interface Algebraic
- Specified by:
getFinal
in class AlgebraicEvalFunc<T>
- Returns:
- A function name of f_final. f_final should be an eval func parametrized by
the same datum as the eval func implementing this interface.
getInitial
public String getInitial()
- Description copied from class:
AlgebraicEvalFunc
- This must be implement as per a normal Algebraic interface. See
Algebraic
for
more information.
- Specified by:
getInitial
in interface Algebraic
- Specified by:
getInitial
in class AlgebraicEvalFunc<T>
- Returns:
- A function name of f_init. f_init should be an eval func.
The return type of f_init.exec() has to be Tuple
getIntermed
public String getIntermed()
- Description copied from class:
AlgebraicEvalFunc
- This must be implement as per a normal Algebraic interface. See
Algebraic
for
more information.
- Specified by:
getIntermed
in interface Algebraic
- Specified by:
getIntermed
in class AlgebraicEvalFunc<T>
- Returns:
- A function name of f_intermed. f_intermed should be an eval func.
The return type of f_intermed.exec() has to be Tuple
Copyright © 2007-2012 The Apache Software Foundation