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.


Constructor Summary
UDFOPPlus()
           
 
Method Summary
 Byte evaluate(Byte a, Byte b)
           
 Double evaluate(Double a, Double b)
           
 Float evaluate(Float a, Float b)
           
 Integer evaluate(Integer a, Integer b)
           
 Long evaluate(Long a, Long b)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.UDF
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 Byte evaluate(Byte a,
                     Byte b)
Specified by:
evaluate in class UDFBaseNumericOp

evaluate

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

evaluate

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

evaluate

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

evaluate

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


Copyright © 2009 The Apache Software Foundation