org.apache.pig
Class PrimitiveEvalFunc<IN,OUT>
java.lang.Object
org.apache.pig.EvalFunc<OUT>
org.apache.pig.TypedOutputEvalFunc<OUT>
org.apache.pig.PrimitiveEvalFunc<IN,OUT>
- Direct Known Subclasses:
- FunctionWrapperEvalFunc
public abstract class PrimitiveEvalFunc<IN,OUT>
- extends TypedOutputEvalFunc<OUT>
Base class for simple Pig UDFs that are functions of primitive types IN to OUT. Handles
marshalling objects, basic error checking, etc. Extend this class and implement the
OUT exec(IN input)
method when writting a UDF that operates on only the first input
(of expected type IN) from the Tuple.
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 |
inTypeClass
protected Class<IN> inTypeClass
PrimitiveEvalFunc
public PrimitiveEvalFunc()
PrimitiveEvalFunc
public PrimitiveEvalFunc(Class inTypeClass,
Class outTypeClass)
getInputTypeClass
public Class<IN> getInputTypeClass()
exec
public OUT exec(Tuple tuple)
throws IOException
- Description copied from class:
EvalFunc
- This callback method must be implemented by all subclasses. This
is the method that will be invoked on every Tuple of a given dataset.
Since the dataset may be divided up in a variety of ways the programmer
should not make assumptions about state that is maintained between
invocations of this method.
- Specified by:
exec
in class EvalFunc<OUT>
- Parameters:
tuple
- the Tuple to be processed.
- Returns:
- result, of type T.
- Throws:
IOException
exec
public abstract OUT exec(IN input)
throws IOException
- Throws:
IOException
Copyright © 2007-2012 The Apache Software Foundation