@InterfaceAudience.Public @InterfaceStability.Stable public abstract class GenericUDF extends Object implements Closeable
GenericUDF.DeferredObject
.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 Deferred 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
UDFArgumentException
public 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.HiveException
public abstract String getDisplayString(String[] children)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public GenericUDF flip()
public GenericUDF negative()
public String getUdfName()
public void copyToNewInstance(Object newInstance) throws UDFArgumentException
UDFArgumentException
protected String getStandardDisplayString(String name, String[] children, String delim)
protected String getFuncName()
protected void checkArgsSize(ObjectInspector[] arguments, int min, int max) throws UDFArgumentLengthException
UDFArgumentLengthException
protected void checkArgPrimitive(ObjectInspector[] arguments, int i) throws UDFArgumentTypeException
UDFArgumentTypeException
protected void checkArgGroups(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, PrimitiveObjectInspectorUtils.PrimitiveGrouping... grps) throws UDFArgumentTypeException
UDFArgumentTypeException
protected void obtainStringConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeException
protected void obtainIntConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeException
protected void obtainLongConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeException
protected void obtainDoubleConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeException
protected void obtainDateConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeException
protected void obtainTimestampConverter(ObjectInspector[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws UDFArgumentTypeException
UDFArgumentTypeException
protected String getStringValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveException
protected Integer getIntValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveException
protected Long getLongValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveException
protected Double getDoubleValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveException
protected Date getDateValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveException
protected Timestamp getTimestampValue(GenericUDF.DeferredObject[] arguments, int i, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveException
protected HiveIntervalYearMonth getIntervalYearMonthValue(GenericUDF.DeferredObject[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveException
protected HiveIntervalDayTime getIntervalDayTimeValue(GenericUDF.DeferredObject[] arguments, int i, PrimitiveObjectInspector.PrimitiveCategory[] inputTypes, ObjectInspectorConverters.Converter[] converters) throws HiveException
HiveException
protected String getConstantStringValue(ObjectInspector[] arguments, int i)
protected Boolean getConstantBooleanValue(ObjectInspector[] arguments, int i) throws UDFArgumentTypeException
UDFArgumentTypeException
protected Integer getConstantIntValue(ObjectInspector[] arguments, int i) throws UDFArgumentTypeException
UDFArgumentTypeException
protected String getArgOrder(int i)
Copyright © 2022 The Apache Software Foundation. All rights reserved.