org.apache.hadoop.hive.ql.exec
Class NumericOpMethodResolver

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.NumericOpMethodResolver
All Implemented Interfaces:
UDFMethodResolver

public class NumericOpMethodResolver
extends Object
implements UDFMethodResolver

The class implements the method resolution for operators like (+, -, *, %). The resolution logic is as follows: 1. If one of the parameters is a string, then it resolves to evaluate(double, double) 2. If one of the parameters is null, then it resolves to evaluate(T, T) where T is the other non-null parameter type. 3. If both of the parameters are null, then it resolves to evaluate(byte, byte) 4. Otherwise, it resolves to evaluate(T, T), where T is the type resulting from calling FunctionRegistry.getCommonClass() on the two arguments.


Constructor Summary
NumericOpMethodResolver(Class<? extends UDF> udfClass)
          Constuctor.
 
Method Summary
 Method getEvalMethod(List<TypeInfo> argTypeInfos)
          Gets the evaluate method for the UDF given the parameter types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericOpMethodResolver

public NumericOpMethodResolver(Class<? extends UDF> udfClass)
Constuctor.

Method Detail

getEvalMethod

public Method getEvalMethod(List<TypeInfo> argTypeInfos)
                     throws UDFArgumentException
Description copied from interface: UDFMethodResolver
Gets the evaluate method for the UDF given the parameter types.

Specified by:
getEvalMethod in interface UDFMethodResolver
Parameters:
argTypeInfos - The list of the argument types that need to matched with the evaluate function signature.
Throws:
UDFArgumentException


Copyright © 2013 The Apache Software Foundation