org.apache.hadoop.hive.ql.exec
Class NumericOpMethodResolver
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NumericOpMethodResolver
public NumericOpMethodResolver(Class<? extends UDF> udfClass)
- Constuctor.
getEvalMethod
public Method getEvalMethod(List<TypeInfo> argTypeInfos)
throws AmbiguousMethodException,
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:
AmbiguousMethodException
UDFArgumentException
Copyright © 2009 The Apache Software Foundation