org.apache.hadoop.hive.serde2.objectinspector.primitive
Class PrimitiveObjectInspectorFactory

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

public final class PrimitiveObjectInspectorFactory
extends Object

PrimitiveObjectInspectorFactory is the primary way to create new PrimitiveObjectInspector instances. The reason of having caches here is that ObjectInspector is because ObjectInspectors do not have an internal state - so ObjectInspectors with the same construction parameters should result in exactly the same ObjectInspector.


Field Summary
static JavaBooleanObjectInspector javaBooleanObjectInspector
           
static JavaBinaryObjectInspector javaByteArrayObjectInspector
           
static JavaByteObjectInspector javaByteObjectInspector
           
static JavaDateObjectInspector javaDateObjectInspector
           
static JavaDoubleObjectInspector javaDoubleObjectInspector
           
static JavaFloatObjectInspector javaFloatObjectInspector
           
static JavaHiveDecimalObjectInspector javaHiveDecimalObjectInspector
           
static JavaHiveVarcharObjectInspector javaHiveVarcharObjectInspector
           
static JavaIntObjectInspector javaIntObjectInspector
           
static JavaLongObjectInspector javaLongObjectInspector
           
static JavaShortObjectInspector javaShortObjectInspector
           
static JavaStringObjectInspector javaStringObjectInspector
           
static JavaTimestampObjectInspector javaTimestampObjectInspector
           
static JavaVoidObjectInspector javaVoidObjectInspector
           
static WritableBinaryObjectInspector writableBinaryObjectInspector
           
static WritableBooleanObjectInspector writableBooleanObjectInspector
           
static WritableByteObjectInspector writableByteObjectInspector
           
static WritableDateObjectInspector writableDateObjectInspector
           
static WritableDoubleObjectInspector writableDoubleObjectInspector
           
static WritableFloatObjectInspector writableFloatObjectInspector
           
static WritableHiveDecimalObjectInspector writableHiveDecimalObjectInspector
           
static WritableHiveVarcharObjectInspector writableHiveVarcharObjectInspector
           
static WritableIntObjectInspector writableIntObjectInspector
           
static WritableLongObjectInspector writableLongObjectInspector
           
static WritableShortObjectInspector writableShortObjectInspector
           
static WritableStringObjectInspector writableStringObjectInspector
           
static WritableTimestampObjectInspector writableTimestampObjectInspector
           
static WritableVoidObjectInspector writableVoidObjectInspector
           
 
Method Summary
static AbstractPrimitiveJavaObjectInspector getPrimitiveJavaObjectInspector(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory)
          Returns the PrimitiveJavaObjectInspector for the PrimitiveCategory.
static AbstractPrimitiveJavaObjectInspector getPrimitiveJavaObjectInspector(PrimitiveTypeSpec typeSpec)
          Returns the PrimitiveJavaObjectInspector for the PrimitiveCategory, with option to pass in parameters for the primitive type (such as char(10)).
static PrimitiveObjectInspector getPrimitiveObjectInspectorFromClass(Class<?> c)
          Returns an ObjectInspector for a primitive Class.
static ConstantObjectInspector getPrimitiveWritableConstantObjectInspector(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory, Object value)
          Returns a PrimitiveWritableObjectInspector which implements ConstantObjectInspector for the PrimitiveCategory.
static ConstantObjectInspector getPrimitiveWritableConstantObjectInspector(PrimitiveTypeSpec typeSpecs, Object value)
          Returns a PrimitiveWritableObjectInspector which implements ConstantObjectInspector for the PrimitiveCategory.
static AbstractPrimitiveWritableObjectInspector getPrimitiveWritableObjectInspector(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory)
          Returns the PrimitiveWritableObjectInspector for the PrimitiveCategory.
static AbstractPrimitiveWritableObjectInspector getPrimitiveWritableObjectInspector(PrimitiveTypeSpec typeSpec)
          Returns the PrimitiveWritableObjectInspector for the PrimitiveCategory, with option to pass in parameters for the primitive type (such as char(10)).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

javaBooleanObjectInspector

public static final JavaBooleanObjectInspector javaBooleanObjectInspector

javaByteObjectInspector

public static final JavaByteObjectInspector javaByteObjectInspector

javaShortObjectInspector

public static final JavaShortObjectInspector javaShortObjectInspector

javaIntObjectInspector

public static final JavaIntObjectInspector javaIntObjectInspector

javaLongObjectInspector

public static final JavaLongObjectInspector javaLongObjectInspector

javaFloatObjectInspector

public static final JavaFloatObjectInspector javaFloatObjectInspector

javaDoubleObjectInspector

public static final JavaDoubleObjectInspector javaDoubleObjectInspector

javaStringObjectInspector

public static final JavaStringObjectInspector javaStringObjectInspector

javaHiveVarcharObjectInspector

public static final JavaHiveVarcharObjectInspector javaHiveVarcharObjectInspector

javaVoidObjectInspector

public static final JavaVoidObjectInspector javaVoidObjectInspector

javaDateObjectInspector

public static final JavaDateObjectInspector javaDateObjectInspector

javaTimestampObjectInspector

public static final JavaTimestampObjectInspector javaTimestampObjectInspector

javaByteArrayObjectInspector

public static final JavaBinaryObjectInspector javaByteArrayObjectInspector

javaHiveDecimalObjectInspector

public static final JavaHiveDecimalObjectInspector javaHiveDecimalObjectInspector

writableBooleanObjectInspector

public static final WritableBooleanObjectInspector writableBooleanObjectInspector

writableByteObjectInspector

public static final WritableByteObjectInspector writableByteObjectInspector

writableShortObjectInspector

public static final WritableShortObjectInspector writableShortObjectInspector

writableIntObjectInspector

public static final WritableIntObjectInspector writableIntObjectInspector

writableLongObjectInspector

public static final WritableLongObjectInspector writableLongObjectInspector

writableFloatObjectInspector

public static final WritableFloatObjectInspector writableFloatObjectInspector

writableDoubleObjectInspector

public static final WritableDoubleObjectInspector writableDoubleObjectInspector

writableStringObjectInspector

public static final WritableStringObjectInspector writableStringObjectInspector

writableHiveVarcharObjectInspector

public static final WritableHiveVarcharObjectInspector writableHiveVarcharObjectInspector

writableVoidObjectInspector

public static final WritableVoidObjectInspector writableVoidObjectInspector

writableDateObjectInspector

public static final WritableDateObjectInspector writableDateObjectInspector

writableTimestampObjectInspector

public static final WritableTimestampObjectInspector writableTimestampObjectInspector

writableBinaryObjectInspector

public static final WritableBinaryObjectInspector writableBinaryObjectInspector

writableHiveDecimalObjectInspector

public static final WritableHiveDecimalObjectInspector writableHiveDecimalObjectInspector
Method Detail

getPrimitiveWritableObjectInspector

public static AbstractPrimitiveWritableObjectInspector getPrimitiveWritableObjectInspector(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory)
Returns the PrimitiveWritableObjectInspector for the PrimitiveCategory.

Parameters:
primitiveCategory -

getPrimitiveWritableObjectInspector

public static AbstractPrimitiveWritableObjectInspector getPrimitiveWritableObjectInspector(PrimitiveTypeSpec typeSpec)
Returns the PrimitiveWritableObjectInspector for the PrimitiveCategory, with option to pass in parameters for the primitive type (such as char(10)). Ideally this method should be used over the method without type parameters, and the type parameters (or lack of parameters) can be determined from the input ObjectInspector, TypeInfo, or TypeEntry. However there are situations where it is not possible to get any information about type parameters, such as when getting an object inspector based on reflection from the java or primitive class.

Parameters:
primitiveCategory - Primitve type category
primitiveTypeParams - Type parameters for the primitve type. Set to null if there are no type parameters
Returns:

getPrimitiveWritableConstantObjectInspector

public static ConstantObjectInspector getPrimitiveWritableConstantObjectInspector(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory,
                                                                                  Object value)
Returns a PrimitiveWritableObjectInspector which implements ConstantObjectInspector for the PrimitiveCategory.

Parameters:
primitiveCategory -
value -

getPrimitiveWritableConstantObjectInspector

public static ConstantObjectInspector getPrimitiveWritableConstantObjectInspector(PrimitiveTypeSpec typeSpecs,
                                                                                  Object value)
Returns a PrimitiveWritableObjectInspector which implements ConstantObjectInspector for the PrimitiveCategory.

Parameters:
primitiveCategory -
typeParams - Type qualifiers for the type (if applicable)
value -

getPrimitiveJavaObjectInspector

public static AbstractPrimitiveJavaObjectInspector getPrimitiveJavaObjectInspector(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory)
Returns the PrimitiveJavaObjectInspector for the PrimitiveCategory.

Parameters:
primitiveCategory -

getPrimitiveJavaObjectInspector

public static AbstractPrimitiveJavaObjectInspector getPrimitiveJavaObjectInspector(PrimitiveTypeSpec typeSpec)
Returns the PrimitiveJavaObjectInspector for the PrimitiveCategory, with option to pass in parameters for the primitive type (such as char(10)). Ideally this method should be used over the method without type parameters, and the type parameters (or lack of parameters) can be determined from the input ObjectInspector, TypeInfo, or TypeEntry. However there are situations where it is not possible to get any information about type parameters, such as when getting an object inspector based on reflection from the java or primitive class.

Parameters:
primitiveCategory - Primitve type category
primitiveTypeParams - Type parameters for the primitve type. Set to null if there are no type parameters
Returns:

getPrimitiveObjectInspectorFromClass

public static PrimitiveObjectInspector getPrimitiveObjectInspectorFromClass(Class<?> c)
Returns an ObjectInspector for a primitive Class. The Class can be a Hive Writable class, or a Java Primitive Class. A runtimeException will be thrown if the class is not recognized as a primitive type by Hive.



Copyright © 2012 The Apache Software Foundation