|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.ql.exec.FunctionRegistry
public final class FunctionRegistry
FunctionRegistry.
Method Summary | ||
---|---|---|
static GenericUDF |
cloneGenericUDF(GenericUDF genericUDF)
Create a copy of an existing GenericUDF. |
|
static GenericUDTF |
cloneGenericUDTF(GenericUDTF genericUDTF)
Create a copy of an existing GenericUDTF. |
|
static TypeInfo |
getCommonClass(TypeInfo a,
TypeInfo b)
Find a common class that objects of both TypeInfo a and TypeInfo b can convert to. |
|
static TypeInfo |
getCommonClassForComparison(TypeInfo a,
TypeInfo b)
Find a common class that objects of both TypeInfo a and TypeInfo b can convert to. |
|
static TypeInfo |
getCommonClassForUnionAll(TypeInfo a,
TypeInfo b)
Find a common class for union-all operator |
|
static FunctionInfo |
getFunctionInfo(String functionName)
|
|
static Set<String> |
getFunctionNames()
Returns a set of registered function names. |
|
static Set<String> |
getFunctionNames(String funcPatternStr)
Returns a set of registered function names. |
|
static Set<String> |
getFunctionSynonyms(String funcName)
Returns the set of synonyms of the supplied function. |
|
static GenericUDAFEvaluator |
getGenericUDAFEvaluator(String name,
List<ObjectInspector> argumentOIs,
boolean isDistinct,
boolean isAllColumns)
Get the GenericUDAF evaluator for the name and argumentClasses. |
|
static GenericUDAFResolver |
getGenericUDAFResolver(String functionName)
|
|
static GenericUDF |
getGenericUDFForAnd()
A shortcut to get the "and" GenericUDF. |
|
static GenericUDF |
getGenericUDFForIndex()
A shortcut to get the "index" GenericUDF. |
|
static Method |
getMethodInternal(Class<?> udfClass,
List<Method> mlist,
boolean exact,
List<TypeInfo> argumentsPassed)
Gets the closest matching method corresponding to the argument list from a list of methods. |
|
static
|
getMethodInternal(Class<? extends T> udfClass,
String methodName,
boolean exact,
List<TypeInfo> argumentClasses)
This method is shared between UDFRegistry and UDAFRegistry. |
|
static boolean |
implicitConvertable(TypeInfo from,
TypeInfo to)
Returns whether it is possible to implicitly convert an object of Class from to Class to. |
|
static Object |
invoke(Method m,
Object thisObject,
Object... arguments)
|
|
static boolean |
isDeterministic(GenericUDF genericUDF)
Returns whether a GenericUDF is deterministic or not. |
|
static boolean |
isOpAnd(ExprNodeDesc desc)
Returns whether the exprNodeDesc is a node of "and". |
|
static boolean |
isOpAndOrNot(ExprNodeDesc desc)
Returns whether the exprNodeDesc is a node of "and", "or", "not". |
|
static boolean |
isOpNot(ExprNodeDesc desc)
Returns whether the exprNodeDesc is a node of "not". |
|
static boolean |
isOpOr(ExprNodeDesc desc)
Returns whether the exprNodeDesc is a node of "or". |
|
static boolean |
isOpPositive(ExprNodeDesc desc)
Returns whether the exprNodeDesc is a node of "positive". |
|
static boolean |
isStateful(GenericUDF genericUDF)
Returns whether a GenericUDF is stateful or not. |
|
static int |
matchCost(TypeInfo argumentPassed,
TypeInfo argumentAccepted,
boolean exact)
Returns -1 if passed does not match accepted. |
|
static void |
registerFunctionsFromPluginJar(URL jarLocation,
ClassLoader classLoader)
Registers Hive functions from a plugin jar, using metadata from the jar's META-INF/class-info.xml. |
|
static void |
registerGenericUDAF(boolean isNative,
String functionName,
GenericUDAFResolver genericUDAFResolver)
|
|
static void |
registerGenericUDF(boolean isNative,
String functionName,
Class<? extends GenericUDF> genericUDFClass)
|
|
static void |
registerGenericUDTF(boolean isNative,
String functionName,
Class<? extends GenericUDTF> genericUDTFClass)
|
|
static boolean |
registerTemporaryFunction(String functionName,
Class<?> udfClass)
Registers the appropriate kind of temporary function based on a class's type. |
|
static void |
registerTemporaryGenericUDAF(String functionName,
GenericUDAFResolver genericUDAFResolver)
|
|
static void |
registerTemporaryGenericUDF(String functionName,
Class<? extends GenericUDF> genericUDFClass)
|
|
static void |
registerTemporaryGenericUDTF(String functionName,
Class<? extends GenericUDTF> genericUDTFClass)
|
|
static void |
registerTemporaryUDAF(String functionName,
Class<? extends UDAF> udafClass)
|
|
static void |
registerTemporaryUDF(String functionName,
Class<? extends UDF> UDFClass,
boolean isOperator)
|
|
static void |
registerUDAF(boolean isNative,
String functionName,
Class<? extends UDAF> udafClass)
|
|
static void |
registerUDF(boolean isNative,
String functionName,
Class<? extends UDF> UDFClass,
boolean isOperator)
|
|
static void |
registerUDF(boolean isNative,
String functionName,
Class<? extends UDF> UDFClass,
boolean isOperator,
String displayName)
|
|
static void |
registerUDF(String functionName,
Class<? extends UDF> UDFClass,
boolean isOperator,
String displayName)
|
|
static void |
unregisterTemporaryUDF(String functionName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void registerTemporaryUDF(String functionName, Class<? extends UDF> UDFClass, boolean isOperator)
public static void registerUDF(boolean isNative, String functionName, Class<? extends UDF> UDFClass, boolean isOperator)
public static void registerUDF(String functionName, Class<? extends UDF> UDFClass, boolean isOperator, String displayName)
public static void registerUDF(boolean isNative, String functionName, Class<? extends UDF> UDFClass, boolean isOperator, String displayName)
public static void registerTemporaryGenericUDF(String functionName, Class<? extends GenericUDF> genericUDFClass)
public static void registerGenericUDF(boolean isNative, String functionName, Class<? extends GenericUDF> genericUDFClass)
public static void registerTemporaryGenericUDTF(String functionName, Class<? extends GenericUDTF> genericUDTFClass)
public static void registerGenericUDTF(boolean isNative, String functionName, Class<? extends GenericUDTF> genericUDTFClass)
public static FunctionInfo getFunctionInfo(String functionName)
public static Set<String> getFunctionNames()
public static Set<String> getFunctionNames(String funcPatternStr)
funcPatternStr
- regular expression of the interested function names
public static Set<String> getFunctionSynonyms(String funcName)
funcName
- the name of the function
public static TypeInfo getCommonClassForUnionAll(TypeInfo a, TypeInfo b)
public static TypeInfo getCommonClassForComparison(TypeInfo a, TypeInfo b)
public static TypeInfo getCommonClass(TypeInfo a, TypeInfo b)
public static boolean implicitConvertable(TypeInfo from, TypeInfo to)
public static GenericUDAFEvaluator getGenericUDAFEvaluator(String name, List<ObjectInspector> argumentOIs, boolean isDistinct, boolean isAllColumns) throws SemanticException
name
- the name of the UDAFargumentOIs
- isDistinct
- isAllColumns
-
SemanticException
public static <T> Method getMethodInternal(Class<? extends T> udfClass, String methodName, boolean exact, List<TypeInfo> argumentClasses) throws UDFArgumentException
UDFArgumentException
public static void registerTemporaryGenericUDAF(String functionName, GenericUDAFResolver genericUDAFResolver)
public static void registerGenericUDAF(boolean isNative, String functionName, GenericUDAFResolver genericUDAFResolver)
public static void registerTemporaryUDAF(String functionName, Class<? extends UDAF> udafClass)
public static void registerUDAF(boolean isNative, String functionName, Class<? extends UDAF> udafClass)
public static void unregisterTemporaryUDF(String functionName) throws HiveException
HiveException
public static GenericUDAFResolver getGenericUDAFResolver(String functionName)
public static Object invoke(Method m, Object thisObject, Object... arguments) throws HiveException
HiveException
public static int matchCost(TypeInfo argumentPassed, TypeInfo argumentAccepted, boolean exact)
public static Method getMethodInternal(Class<?> udfClass, List<Method> mlist, boolean exact, List<TypeInfo> argumentsPassed) throws UDFArgumentException
mlist
- The list of methods to inspect.exact
- Boolean to indicate whether this is an exact match or not.argumentsPassed
- The classes for the argument.
UDFArgumentException
public static GenericUDF getGenericUDFForIndex()
public static GenericUDF getGenericUDFForAnd()
public static GenericUDF cloneGenericUDF(GenericUDF genericUDF)
public static GenericUDTF cloneGenericUDTF(GenericUDTF genericUDTF)
public static boolean isDeterministic(GenericUDF genericUDF)
public static boolean isStateful(GenericUDF genericUDF)
public static boolean isOpAndOrNot(ExprNodeDesc desc)
public static boolean isOpAnd(ExprNodeDesc desc)
public static boolean isOpOr(ExprNodeDesc desc)
public static boolean isOpNot(ExprNodeDesc desc)
public static boolean isOpPositive(ExprNodeDesc desc)
public static boolean registerTemporaryFunction(String functionName, Class<?> udfClass)
functionName
- name under which to register functionudfClass
- class implementing UD[A|T]F
public static void registerFunctionsFromPluginJar(URL jarLocation, ClassLoader classLoader) throws Exception
jarLocation
- URL for reading jar fileclassLoader
- classloader to use for loading function classes
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |