public class FunctionWrapperEvalFunc extends PrimitiveEvalFunc<Object,Object>
The Function must have a default no-arg constructor, which will be used. For Functions that
take args in the constructor, initialize the function in a subclass of this one and call
super(function)
.
Example: DEFINE myUdf FunctionWrapperEvalFunc('MyFunction')
EvalFunc.SchemaType
inTypeClass
outTypeClass
log, pigLogger, reporter, returnType
Modifier | Constructor and Description |
---|---|
protected |
FunctionWrapperEvalFunc(ExceptionalFunction function)
Determines the input and output types of the Function and initializes the superclass.
|
protected |
FunctionWrapperEvalFunc(com.google.common.base.Function function)
Determines the input and output types of the Function and initializes the superclass.
|
|
FunctionWrapperEvalFunc(String functionClassName)
Takes the class name of a Function, initializes it using the default constructor and passes
it to FunctionWrapperEvalFunc(ExceptionalFunction function).
|
Modifier and Type | Method and Description |
---|---|
Object |
exec(Object input) |
protected String |
getCounterGroup()
Incremented counters will use this as the counter group.
|
exec, getInputTypeClass
getOutputTypeClass, getTypeArguments, safeIncrCounter, verifyInput, verifyUdfInput
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, outputSchema, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public FunctionWrapperEvalFunc(String functionClassName) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, IOException
functionClassName
- function class to initializeClassNotFoundException
NoSuchMethodException
IllegalAccessException
InstantiationException
IOException
protected FunctionWrapperEvalFunc(com.google.common.base.Function function) throws IOException, ClassNotFoundException, NoSuchMethodException
function
- Function to be used by the UDF.IOException
ClassNotFoundException
NoSuchMethodException
protected FunctionWrapperEvalFunc(ExceptionalFunction function) throws IOException, ClassNotFoundException, NoSuchMethodException
function
- Function to be used by the UDF.IOException
ClassNotFoundException
NoSuchMethodException
public Object exec(Object input) throws IOException
exec
in class PrimitiveEvalFunc<Object,Object>
IOException
protected String getCounterGroup()
TypedOutputEvalFunc
getCounterGroup
in class TypedOutputEvalFunc<Object>
Copyright © 2007-2017 The Apache Software Foundation