org.apache.hadoop.hive.serde2.objectinspector
Class ObjectInspectorUtils

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils

public class ObjectInspectorUtils
extends Object

ObjectInspectorFactory is the primary way to create new ObjectInspector instances. SerDe classes should call the static functions in this library to create an ObjectInspector to return to the caller of SerDe2.getObjectInspector().


Field Summary
static Map<Class<?>,String> classToTypeName
           
static Map<String,Class<?>> typeNameToClass
          The mapping from type name in DDL to the Java class.
 
Constructor Summary
ObjectInspectorUtils()
           
 
Method Summary
static Class<?> generalizePrimitive(Class<?> primitiveClass)
          Generalize the Java primitive types to the corresponding Java Classes.
static String getClassShortName(Class<?> classObject)
          Get the short name for the types
static ArrayList<String> getIntegerArray(int size)
          Returns an array of Integer strings, starting from "0".
static String getIntegerCSV(int size)
           
static Object getStandardObject(Object o, ObjectInspector oi)
           
static ObjectInspector getStandardObjectInspector(ObjectInspector oi)
          Get the standard ObjectInspector for an ObjectInspector.
static StructField getStandardStructFieldRef(String fieldName, List<? extends StructField> fields)
           
static String getStandardStructTypeName(StructObjectInspector soi)
           
static boolean isPrimitiveClass(Class<?> c)
          This function defines the list of PrimitiveClasses that we support.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classToTypeName

public static final Map<Class<?>,String> classToTypeName

typeNameToClass

public static final Map<String,Class<?>> typeNameToClass
The mapping from type name in DDL to the Java class.

Constructor Detail

ObjectInspectorUtils

public ObjectInspectorUtils()
Method Detail

isPrimitiveClass

public static boolean isPrimitiveClass(Class<?> c)
This function defines the list of PrimitiveClasses that we support. A PrimitiveClass should support java serialization/deserialization.


generalizePrimitive

public static Class<?> generalizePrimitive(Class<?> primitiveClass)
Generalize the Java primitive types to the corresponding Java Classes.


getClassShortName

public static String getClassShortName(Class<?> classObject)
Get the short name for the types


getIntegerArray

public static ArrayList<String> getIntegerArray(int size)
Returns an array of Integer strings, starting from "0". This function caches the arrays to provide a better performance.


getIntegerCSV

public static String getIntegerCSV(int size)

getStandardObjectInspector

public static ObjectInspector getStandardObjectInspector(ObjectInspector oi)
Get the standard ObjectInspector for an ObjectInspector. The returned ObjectInspector can be used to inspect the standard object.


getStandardObject

public static Object getStandardObject(Object o,
                                       ObjectInspector oi)

getStandardStructTypeName

public static String getStandardStructTypeName(StructObjectInspector soi)

getStandardStructFieldRef

public static StructField getStandardStructFieldRef(String fieldName,
                                                    List<? extends StructField> fields)


Copyright © 2009 The Apache Software Foundation