org.apache.hadoop.hive.ql.udf
Class UDFOPPlus

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.UDF
      extended by org.apache.hadoop.hive.ql.udf.UDFBaseNumericOp
          extended by org.apache.hadoop.hive.ql.udf.UDFOPPlus

public class UDFOPPlus
extends UDFBaseNumericOp

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.


Field Summary
 
Fields inherited from class org.apache.hadoop.hive.ql.udf.UDFBaseNumericOp
bigDecimalWritable, byteWritable, doubleWritable, floatWritable, intWritable, longWritable, shortWritable
 
Constructor Summary
UDFOPPlus()
           
 
Method Summary
 BigDecimalWritable evaluate(BigDecimalWritable a, BigDecimalWritable b)
           
 ByteWritable evaluate(ByteWritable a, ByteWritable b)
           
 DoubleWritable evaluate(DoubleWritable a, DoubleWritable b)
           
 org.apache.hadoop.io.FloatWritable evaluate(org.apache.hadoop.io.FloatWritable a, org.apache.hadoop.io.FloatWritable b)
           
 org.apache.hadoop.io.IntWritable evaluate(org.apache.hadoop.io.IntWritable a, org.apache.hadoop.io.IntWritable b)
           
 org.apache.hadoop.io.LongWritable evaluate(org.apache.hadoop.io.LongWritable a, org.apache.hadoop.io.LongWritable b)
           
 ShortWritable evaluate(ShortWritable a, ShortWritable b)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.UDF
getRequiredFiles, getRequiredJars, getResolver, setResolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDFOPPlus

public UDFOPPlus()
Method Detail

evaluate

public ByteWritable evaluate(ByteWritable a,
                             ByteWritable b)
Specified by:
evaluate in class UDFBaseNumericOp

evaluate

public ShortWritable evaluate(ShortWritable a,
                              ShortWritable b)
Specified by:
evaluate in class UDFBaseNumericOp

evaluate

public org.apache.hadoop.io.IntWritable evaluate(org.apache.hadoop.io.IntWritable a,
                                                 org.apache.hadoop.io.IntWritable b)
Specified by:
evaluate in class UDFBaseNumericOp

evaluate

public org.apache.hadoop.io.LongWritable evaluate(org.apache.hadoop.io.LongWritable a,
                                                  org.apache.hadoop.io.LongWritable b)
Specified by:
evaluate in class UDFBaseNumericOp

evaluate

public org.apache.hadoop.io.FloatWritable evaluate(org.apache.hadoop.io.FloatWritable a,
                                                   org.apache.hadoop.io.FloatWritable b)
Specified by:
evaluate in class UDFBaseNumericOp

evaluate

public DoubleWritable evaluate(DoubleWritable a,
                               DoubleWritable b)
Specified by:
evaluate in class UDFBaseNumericOp

evaluate

public BigDecimalWritable evaluate(BigDecimalWritable a,
                                   BigDecimalWritable b)
Specified by:
evaluate in class UDFBaseNumericOp


Copyright © 2013 The Apache Software Foundation