public abstract class GenericUDF
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
GenericUDF.DeferredJavaObject
A basic dummy implementation of DeferredObject which just stores a Java
Object reference.
|
static interface |
GenericUDF.DeferredObject
A Defered Object allows us to do lazy-evaluation and short-circuiting.
|
| Constructor and Description |
|---|
GenericUDF()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close GenericUDF.
|
void |
configure(MapredContext context)
Additionally setup GenericUDF with MapredContext before initializing.
|
abstract java.lang.Object |
evaluate(GenericUDF.DeferredObject[] arguments)
Evaluate the GenericUDF with the arguments.
|
abstract java.lang.String |
getDisplayString(java.lang.String[] children)
Get the String to be displayed in explain.
|
java.lang.String[] |
getRequiredFiles() |
java.lang.String[] |
getRequiredJars()
The following two functions can be overridden to automatically include
additional resources required by this UDF.
|
abstract ObjectInspector |
initialize(ObjectInspector[] arguments)
Initialize this GenericUDF.
|
ObjectInspector |
initializeAndFoldConstants(ObjectInspector[] arguments)
Initialize this GenericUDF.
|
public abstract ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException
arguments - The ObjectInspector for the argumentsUDFArgumentException - Thrown when arguments have wrong types, wrong length, etc.public void configure(MapredContext context)
context - contextpublic ObjectInspector initializeAndFoldConstants(ObjectInspector[] arguments) throws UDFArgumentException
UDFArgumentExceptionpublic java.lang.String[] getRequiredJars()
public java.lang.String[] getRequiredFiles()
public abstract java.lang.Object evaluate(GenericUDF.DeferredObject[] arguments) throws HiveException
arguments - The arguments as DeferedObject, use DeferedObject.get() to get the
actual argument Object. The Objects can be inspected by the
ObjectInspectors passed in the initialize call.HiveExceptionpublic abstract java.lang.String getDisplayString(java.lang.String[] children)
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionCopyright © 2012 The Apache Software Foundation