public final class TypeInfoUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TypeInfoUtils.PrimitiveParts |
| Modifier and Type | Field and Description |
|---|---|
static java.util.List<org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory> |
numericTypeList |
static java.util.EnumMap<org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory,java.lang.Integer> |
numericTypes |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
doPrimitiveCategoriesMatch(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo ti1,
org.apache.hadoop.hive.serde2.typeinfo.TypeInfo ti2)
returns true if both TypeInfos are of primitive type, and the primitive category matches.
|
static java.lang.reflect.Type |
getArrayElementType(java.lang.reflect.Type t)
Returns the array element type, if the Type is an array (Object[]), or
GenericArrayType (
Map<String,String>[]). |
static java.lang.String |
getBaseName(java.lang.String typeName) |
static int |
getCharacterLengthForType(org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo typeInfo)
Return the character length of the type
|
static java.util.List<org.apache.hadoop.hive.serde2.typeinfo.TypeInfo> |
getParameterTypeInfos(java.lang.reflect.Method m,
int size)
Get the parameter TypeInfo for a method.
|
static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector |
getStandardJavaObjectInspectorFromTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo typeInfo)
Returns the standard object inspector that can be used to translate an
object of that typeInfo to a standard object type.
|
static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector |
getStandardWritableObjectInspectorFromTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo typeInfo)
Returns the standard object inspector that can be used to translate an
object of that typeInfo to a standard object type.
|
static org.apache.hadoop.hive.serde2.typeinfo.TypeInfo |
getTypeInfoFromObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector oi)
Get the TypeInfo object from the ObjectInspector object by recursively
going into the ObjectInspector structure.
|
static org.apache.hadoop.hive.serde2.typeinfo.TypeInfo |
getTypeInfoFromTypeString(java.lang.String typeString) |
static java.util.ArrayList<org.apache.hadoop.hive.serde2.typeinfo.TypeInfo> |
getTypeInfosFromTypeString(java.lang.String typeString) |
static java.util.List<java.lang.String> |
getTypeStringsFromTypeInfo(java.util.List<org.apache.hadoop.hive.serde2.typeinfo.TypeInfo> typeInfos) |
static boolean |
hasParameters(java.lang.String typeName) |
static boolean |
implicitConvertible(org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory from,
org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory to) |
static boolean |
implicitConvertible(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo from,
org.apache.hadoop.hive.serde2.typeinfo.TypeInfo to)
Returns whether it is possible to implicitly convert an object of Class
from to Class to.
|
static boolean |
isConversionRequiredForComparison(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo typeA,
org.apache.hadoop.hive.serde2.typeinfo.TypeInfo typeB)
Given two types, determine whether conversion needs to occur to compare the two types.
|
static TypeInfoUtils.PrimitiveParts |
parsePrimitiveParts(java.lang.String typeInfoString)
Make some of the TypeInfo parsing available as a utility.
|
static void |
registerNumericType(org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory primitiveCategory,
int level) |
static java.util.ArrayList<org.apache.hadoop.hive.serde2.typeinfo.TypeInfo> |
typeInfosFromStructObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector structObjectInspector) |
static java.util.ArrayList<org.apache.hadoop.hive.serde2.typeinfo.TypeInfo> |
typeInfosFromTypeNames(java.util.List<java.lang.String> typeNames) |
public static java.util.List<org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory> numericTypeList
public static java.util.EnumMap<org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory,java.lang.Integer> numericTypes
public static java.lang.reflect.Type getArrayElementType(java.lang.reflect.Type t)
Map<String,String>[]). Otherwise return null.public static java.util.List<org.apache.hadoop.hive.serde2.typeinfo.TypeInfo> getParameterTypeInfos(java.lang.reflect.Method m,
int size)
size - In case the last parameter of Method is an array, we will try to
return a List<TypeInfo> with the specified size by repeating the
element of the array at the end. In case the size is smaller than
the minimum possible number of arguments for the method, null will
be returned.public static boolean hasParameters(java.lang.String typeName)
public static java.lang.String getBaseName(java.lang.String typeName)
public static boolean doPrimitiveCategoriesMatch(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo ti1,
org.apache.hadoop.hive.serde2.typeinfo.TypeInfo ti2)
ti1 - ti2 - public static TypeInfoUtils.PrimitiveParts parsePrimitiveParts(java.lang.String typeInfoString)
public static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector getStandardWritableObjectInspectorFromTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo typeInfo)
public static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector getStandardJavaObjectInspectorFromTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo typeInfo)
public static org.apache.hadoop.hive.serde2.typeinfo.TypeInfo getTypeInfoFromObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector oi)
public static java.util.ArrayList<org.apache.hadoop.hive.serde2.typeinfo.TypeInfo> typeInfosFromStructObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector structObjectInspector)
public static java.util.ArrayList<org.apache.hadoop.hive.serde2.typeinfo.TypeInfo> typeInfosFromTypeNames(java.util.List<java.lang.String> typeNames)
public static java.util.ArrayList<org.apache.hadoop.hive.serde2.typeinfo.TypeInfo> getTypeInfosFromTypeString(java.lang.String typeString)
public static java.util.List<java.lang.String> getTypeStringsFromTypeInfo(java.util.List<org.apache.hadoop.hive.serde2.typeinfo.TypeInfo> typeInfos)
public static org.apache.hadoop.hive.serde2.typeinfo.TypeInfo getTypeInfoFromTypeString(java.lang.String typeString)
public static boolean isConversionRequiredForComparison(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo typeA,
org.apache.hadoop.hive.serde2.typeinfo.TypeInfo typeB)
typeA - typeB - public static int getCharacterLengthForType(org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo typeInfo)
typeInfo - public static void registerNumericType(org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory primitiveCategory,
int level)
public static boolean implicitConvertible(org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory from,
org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory to)
public static boolean implicitConvertible(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo from,
org.apache.hadoop.hive.serde2.typeinfo.TypeInfo to)
Copyright © 2021 Apache Software Foundation. All rights reserved.