public class HiveReflectUtil extends Object
ReflectUtil
. It contains methods to wrap a Calcite dispatcher
(based on reflection) into a Hive dispatcher as well as a Hive
dispatcher implementation based on LambdaMetafactory
.Modifier and Type | Class and Description |
---|---|
static interface |
HiveReflectUtil.ClassMethodDispatcher<T,E> |
protected static class |
HiveReflectUtil.HiveMethodDispatcher<T,E> |
protected static class |
HiveReflectUtil.VisitDispatcher<R extends org.apache.calcite.util.ReflectiveVisitor,E> |
Constructor and Description |
---|
HiveReflectUtil() |
Modifier and Type | Method and Description |
---|---|
protected static <T,E> org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveReflectUtil.MethodDispatcherWrapper<T,E> |
createCalciteMethodDispatcherWrapper(org.apache.calcite.util.ReflectUtil.MethodDispatcher<T> methodDispatcher)
Creates a Hive dispatcher that wraps a Calcite one.
|
protected static <E,T> HiveReflectUtil.HiveMethodDispatcher<T,E> |
createMethodDispatcher(Class<T> returnClazz,
org.apache.calcite.util.ReflectiveVisitor visitor,
String methodName,
Class<E> arg0Clazz,
Class... otherArgClasses)
Creates a dispatcher for calls to a single multi-method on a particular
object.
|
protected static <T,E> org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveReflectUtil.MethodDispatcherWrapper<T,E> createCalciteMethodDispatcherWrapper(org.apache.calcite.util.ReflectUtil.MethodDispatcher<T> methodDispatcher)
protected static <E,T> HiveReflectUtil.HiveMethodDispatcher<T,E> createMethodDispatcher(Class<T> returnClazz, org.apache.calcite.util.ReflectiveVisitor visitor, String methodName, Class<E> arg0Clazz, Class... otherArgClasses)
Calls to that multi-method are resolved by looking for a method on the runtime type of that object, with the required name, and with the correct type or a subclass for the first argument, and precisely the same types for other arguments.
For instance, a dispatcher created for the method
String foo(Vehicle, int, List)
could be used to call the methods
String foo(Car, int, List)
String foo(Bus, int, List)
(because Car and Bus are subclasses of Vehicle, and they occur in the polymorphic first argument) but not the method
String foo(Car, int, ArrayList)
(only the first argument is polymorphic).
You must create an implementation of the method for the base class.
Otherwise throws IllegalArgumentException
.
returnClazz
- Return type of methodvisitor
- Object on which to invoke the methodmethodName
- Name of methodarg0Clazz
- Base type of argument zerootherArgClasses
- Types of remaining argumentsCopyright © 2022 The Apache Software Foundation. All rights reserved.