public class HiveReflectionUtils extends Object
They are put here not for code sharing. Rather, this is a boiler place for managing similar code that involves reflection. (In fact, they could be just private method in their respective calling class.)
Relevant Hive methods cannot be called directly because shimming is required to support different, possibly incompatible Hive versions.
Constructor and Description |
---|
HiveReflectionUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector |
createConstantObjectInspector(String className,
Class<?> valueClz,
Object value) |
static List<String> |
getPvals(HiveShim hiveShim,
List<org.apache.hadoop.hive.metastore.api.FieldSchema> partCols,
Map<String,String> partSpec) |
static Properties |
getTableMetadata(HiveShim hiveShim,
org.apache.hadoop.hive.metastore.api.Table table) |
static Object |
invokeMethod(Class clz,
Object obj,
String methodName,
Class[] argClz,
Object[] args) |
static Class |
tryGetClass(String name) |
static Method |
tryGetMethod(Class clz,
String name,
Class[] argTypes) |
public static Properties getTableMetadata(HiveShim hiveShim, org.apache.hadoop.hive.metastore.api.Table table)
public static List<String> getPvals(HiveShim hiveShim, List<org.apache.hadoop.hive.metastore.api.FieldSchema> partCols, Map<String,String> partSpec)
public static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector createConstantObjectInspector(String className, Class<?> valueClz, Object value)
public static Object invokeMethod(Class clz, Object obj, String methodName, Class[] argClz, Object[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.