public abstract class GenericUDFBaseNumeric extends GenericUDFBaseBinary
GenericUDF.DeferredJavaObject, GenericUDF.DeferredObject
Modifier and Type | Field and Description |
---|---|
protected boolean |
ansiSqlArithmetic |
protected ByteWritable |
byteWritable |
protected boolean |
confLookupNeeded |
protected ObjectInspectorConverters.Converter |
converterLeft |
protected ObjectInspectorConverters.Converter |
converterRight |
protected HiveDecimalWritable |
decimalWritable |
protected DoubleWritable |
doubleWritable |
protected org.apache.hadoop.io.FloatWritable |
floatWritable |
protected org.apache.hadoop.io.IntWritable |
intWritable |
protected PrimitiveObjectInspector |
leftOI |
protected org.apache.hadoop.io.LongWritable |
longWritable |
protected PrimitiveObjectInspector |
resultOI |
protected PrimitiveObjectInspector |
rightOI |
protected ShortWritable |
shortWritable |
opDisplayName, opName
Constructor and Description |
---|
GenericUDFBaseNumeric() |
Modifier and Type | Method and Description |
---|---|
void |
copyToNewInstance(Object newInstance)
Some information may be set during initialize() which needs to be saved when the UDF is copied.
|
protected PrimitiveTypeInfo |
deriveResultApproxTypeInfo()
Default implementation for getting the approximate type info for the operator result.
|
protected DecimalTypeInfo |
deriveResultDecimalTypeInfo()
Derive the object inspector instance for the decimal result of the operator.
|
protected abstract DecimalTypeInfo |
deriveResultDecimalTypeInfo(int prec1,
int scale1,
int prec2,
int scale2) |
protected PrimitiveTypeInfo |
deriveResultExactTypeInfo()
Default implementation for getting the exact type info for the operator result.
|
protected ByteWritable |
evaluate(ByteWritable left,
ByteWritable right) |
protected DoubleWritable |
evaluate(DoubleWritable left,
DoubleWritable right) |
protected org.apache.hadoop.io.FloatWritable |
evaluate(org.apache.hadoop.io.FloatWritable left,
org.apache.hadoop.io.FloatWritable right) |
Object |
evaluate(GenericUDF.DeferredObject[] arguments)
Evaluate the GenericUDF with the arguments.
|
protected HiveDecimalWritable |
evaluate(HiveDecimal left,
HiveDecimal right) |
protected org.apache.hadoop.io.IntWritable |
evaluate(org.apache.hadoop.io.IntWritable left,
org.apache.hadoop.io.IntWritable right) |
protected org.apache.hadoop.io.LongWritable |
evaluate(org.apache.hadoop.io.LongWritable left,
org.apache.hadoop.io.LongWritable right) |
protected ShortWritable |
evaluate(ShortWritable left,
ShortWritable right) |
ObjectInspector |
initialize(ObjectInspector[] arguments)
Initialize this GenericUDF.
|
boolean |
isAnsiSqlArithmetic() |
boolean |
isConfLookupNeeded() |
void |
setAnsiSqlArithmetic(boolean ansiSqlArithmetic) |
void |
setConfLookupNeeded(boolean confLookupNeeded) |
getDisplayString
checkArgGroups, checkArgPrimitive, checkArgsSize, close, configure, flip, getArgOrder, getConstantIntValue, getConstantLongValue, getConstantStringValue, getDateValue, getDoubleValue, getFuncName, getIntValue, getLongValue, getRequiredFiles, getRequiredJars, getStandardDisplayString, getStandardDisplayString, getStringValue, getTimestampValue, getUdfName, initializeAndFoldConstants, negative, obtainDateConverter, obtainDoubleConverter, obtainIntConverter, obtainLongConverter, obtainStringConverter, obtainTimestampConverter
protected transient PrimitiveObjectInspector leftOI
protected transient PrimitiveObjectInspector rightOI
protected transient PrimitiveObjectInspector resultOI
protected transient ObjectInspectorConverters.Converter converterLeft
protected transient ObjectInspectorConverters.Converter converterRight
protected ByteWritable byteWritable
protected ShortWritable shortWritable
protected org.apache.hadoop.io.IntWritable intWritable
protected org.apache.hadoop.io.LongWritable longWritable
protected org.apache.hadoop.io.FloatWritable floatWritable
protected DoubleWritable doubleWritable
protected HiveDecimalWritable decimalWritable
protected boolean confLookupNeeded
protected boolean ansiSqlArithmetic
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException
GenericUDF
initialize
in class GenericUDF
arguments
- The ObjectInspector for the argumentsUDFArgumentException
- Thrown when arguments have wrong types, wrong length, etc.public Object evaluate(GenericUDF.DeferredObject[] arguments) throws HiveException
GenericUDF
evaluate
in class GenericUDF
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
protected ByteWritable evaluate(ByteWritable left, ByteWritable right)
protected ShortWritable evaluate(ShortWritable left, ShortWritable right)
protected org.apache.hadoop.io.IntWritable evaluate(org.apache.hadoop.io.IntWritable left, org.apache.hadoop.io.IntWritable right)
protected org.apache.hadoop.io.LongWritable evaluate(org.apache.hadoop.io.LongWritable left, org.apache.hadoop.io.LongWritable right)
protected org.apache.hadoop.io.FloatWritable evaluate(org.apache.hadoop.io.FloatWritable left, org.apache.hadoop.io.FloatWritable right)
protected DoubleWritable evaluate(DoubleWritable left, DoubleWritable right)
protected HiveDecimalWritable evaluate(HiveDecimal left, HiveDecimal right)
protected PrimitiveTypeInfo deriveResultApproxTypeInfo()
protected PrimitiveTypeInfo deriveResultExactTypeInfo()
protected DecimalTypeInfo deriveResultDecimalTypeInfo()
protected abstract DecimalTypeInfo deriveResultDecimalTypeInfo(int prec1, int scale1, int prec2, int scale2)
public void copyToNewInstance(Object newInstance) throws UDFArgumentException
GenericUDF
copyToNewInstance
in class GenericUDF
UDFArgumentException
public boolean isConfLookupNeeded()
public void setConfLookupNeeded(boolean confLookupNeeded)
public boolean isAnsiSqlArithmetic()
public void setAnsiSqlArithmetic(boolean ansiSqlArithmetic)
Copyright © 2017 The Apache Software Foundation. All rights reserved.