org.apache.hadoop.hive.ql.udf.generic
Class GenericUDFOPPlus
java.lang.Object
org.apache.hadoop.hive.ql.udf.generic.GenericUDF
org.apache.hadoop.hive.ql.udf.generic.GenericUDFBaseNumeric
org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPPlus
- All Implemented Interfaces:
- Closeable
public class GenericUDFOPPlus
- extends GenericUDFBaseNumeric
The reason that we list evaluate methods with all numeric types is for both
better performance and type checking (so we know int + int is still an int
instead of a double); otherwise a single method that takes (Number a, Number
b) and use a.doubleValue() == b.doubleValue() is enough.
The case of int + double will be handled by implicit type casting using
UDFRegistry.implicitConvertable method.
| Fields inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBaseNumeric |
ansiSqlArithmetic, byteWritable, confLookupNeeded, converterLeft, converterRight, decimalWritable, doubleWritable, floatWritable, intWritable, leftOI, longWritable, opDisplayName, opName, resultOI, rightOI, shortWritable |
|
Method Summary |
protected DecimalTypeInfo |
deriveResultDecimalTypeInfo(int prec1,
int scale1,
int prec2,
int scale2)
|
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)
|
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)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericUDFOPPlus
public GenericUDFOPPlus()
evaluate
protected ByteWritable evaluate(ByteWritable left,
ByteWritable right)
- Overrides:
evaluate in class GenericUDFBaseNumeric
evaluate
protected ShortWritable evaluate(ShortWritable left,
ShortWritable right)
- Overrides:
evaluate in class GenericUDFBaseNumeric
evaluate
protected org.apache.hadoop.io.IntWritable evaluate(org.apache.hadoop.io.IntWritable left,
org.apache.hadoop.io.IntWritable right)
- Overrides:
evaluate in class GenericUDFBaseNumeric
evaluate
protected org.apache.hadoop.io.LongWritable evaluate(org.apache.hadoop.io.LongWritable left,
org.apache.hadoop.io.LongWritable right)
- Overrides:
evaluate in class GenericUDFBaseNumeric
evaluate
protected org.apache.hadoop.io.FloatWritable evaluate(org.apache.hadoop.io.FloatWritable left,
org.apache.hadoop.io.FloatWritable right)
- Overrides:
evaluate in class GenericUDFBaseNumeric
evaluate
protected DoubleWritable evaluate(DoubleWritable left,
DoubleWritable right)
- Overrides:
evaluate in class GenericUDFBaseNumeric
evaluate
protected HiveDecimalWritable evaluate(HiveDecimal left,
HiveDecimal right)
- Overrides:
evaluate in class GenericUDFBaseNumeric
deriveResultDecimalTypeInfo
protected DecimalTypeInfo deriveResultDecimalTypeInfo(int prec1,
int scale1,
int prec2,
int scale2)
- Specified by:
deriveResultDecimalTypeInfo in class GenericUDFBaseNumeric
Copyright © 2014 The Apache Software Foundation. All rights reserved.