org.apache.pig.impl.builtin
Class StreamingUDF
java.lang.Object
org.apache.pig.EvalFunc<Object>
org.apache.pig.impl.builtin.StreamingUDF
public class StreamingUDF
- extends EvalFunc<Object>
Method Summary |
Object |
exec(Tuple input)
This callback method must be implemented by all subclasses. |
static List<String> |
getResourcesForJar()
Returns a list of file names (relative to root of pig jar) of files that need to be
included in the jar shipped to the cluster. |
Schema |
outputSchema(Schema input)
Report the schema of the output of this UDF. |
Methods inherited from class org.apache.pig.EvalFunc |
finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TURN_ON_OUTPUT_CAPTURING
public static final String TURN_ON_OUTPUT_CAPTURING
- See Also:
- Constant Field Values
StreamingUDF
public StreamingUDF(String language,
String filePath,
String funcName,
String outputSchemaString,
String schemaLineNumber,
String execType,
String isIllustrate)
throws StreamingUDFOutputSchemaException,
ExecException
- Throws:
StreamingUDFOutputSchemaException
ExecException
exec
public Object exec(Tuple input)
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<Object>
- Parameters:
input
- the Tuple to be processed.
- Returns:
- result, of type T.
- Throws:
IOException
getResourcesForJar
public static List<String> getResourcesForJar()
- Returns a list of file names (relative to root of pig jar) of files that need to be
included in the jar shipped to the cluster.
Will need to be smarter as more languages are added and the controller files are large.
- Returns:
outputSchema
public Schema outputSchema(Schema input)
- Description copied from class:
EvalFunc
- Report the schema of the output of this UDF. Pig will make use of
this in error checking, optimization, and planning. The schema
of input data to this UDF is provided.
The default implementation interprets the OutputSchema
annotation,
if one is present. Otherwise, it returns null
(no known output schema).
- Overrides:
outputSchema
in class EvalFunc<Object>
- Parameters:
input
- Schema of the input
- Returns:
- Schema of the output
Copyright © 2007-2012 The Apache Software Foundation