public abstract class GenericUDF extends Object implements 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.
|
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 String[] getRequiredJars()
public String[] getRequiredFiles()
public abstract 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 String getDisplayString(String[] children)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic GenericUDF flip()
public GenericUDF negative()
UDFArgumentExceptionpublic String getUdfName()
public void copyToNewInstance(Object newInstance) throws UDFArgumentException
UDFArgumentExceptionprotected String getStandardDisplayString(String name, String[] children, String delim)
protected String getFuncName()
protected void checkArgsSize(ObjectInspector[] arguments, int min, int max) throws UDFArgumentLengthException
UDFArgumentLengthExceptionprotected void checkArgPrimitive(ObjectInspector[] arguments, int i) throws UDFArgumentTypeException
UDFArgumentTypeExceptionprotected void checkArgGroups(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, PrimitiveObjectInspectorUtils.PrimitiveGrouping... grps) throws UDFArgumentTypeException
UDFArgumentTypeExceptionprotected void obtainStringConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeExceptionprotected void obtainIntConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeExceptionprotected void obtainLongConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeExceptionprotected void obtainDoubleConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeExceptionprotected void obtainDateConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeExceptionprotected void obtainTimestampConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeExceptionprotected String getStringValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveExceptionprotected Integer getIntValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveExceptionprotected Long getLongValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveExceptionprotected Double getDoubleValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveExceptionprotected Date getDateValue(GenericUDF.DeferredObject[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveExceptionprotected Timestamp getTimestampValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveExceptionprotected String getConstantStringValue(ObjectInspector[] arguments, int i)
protected Integer getConstantIntValue(ObjectInspector[] arguments, int i) throws UDFArgumentTypeException
UDFArgumentTypeExceptionprotected Long getConstantLongValue(ObjectInspector[] arguments, int i) throws UDFArgumentTypeException
UDFArgumentTypeExceptionprotected String getArgOrder(int i)
Copyright © 2017 The Apache Software Foundation. All rights reserved.