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

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

public class DefaultUDFMethodResolver
extends Object
implements UDFMethodResolver

The default UDF Method resolver. This resolver is used for resolving the UDF method that is to be used for evaluation given the list of the argument types. The getEvalMethod goes through all the evaluate methods and returns the one that matches the argument signature or is the closest match. Closest match is defined as the one that requires the least number of arguments to be converted. In case more than one matches are found, the method throws an ambiguous method exception.


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

Constructor Detail

DefaultUDFMethodResolver

public DefaultUDFMethodResolver(Class<? extends UDF> udfClass)
Constructor. This constructor sets the resolver to be used for comparison operators. See UDFMethodResolver

Method Detail

getEvalMethod

public Method getEvalMethod(List<TypeInfo> argClasses)
                     throws UDFArgumentException
Gets the evaluate method for the UDF given the parameter types.

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


Copyright © 2014 The Apache Software Foundation. All rights reserved.