org.apache.hadoop.hive.serde2.objectinspector
Interface PrimitiveObjectInspector

All Superinterfaces:
Cloneable, ObjectInspector, PrimitiveTypeSpec
All Known Subinterfaces:
BinaryObjectInspector, BooleanObjectInspector, ByteObjectInspector, DateObjectInspector, DoubleObjectInspector, FloatObjectInspector, HiveDecimalObjectInspector, HiveVarcharObjectInspector, IntObjectInspector, LongObjectInspector, SettableBinaryObjectInspector, SettableBooleanObjectInspector, SettableByteObjectInspector, SettableDateObjectInspector, SettableDoubleObjectInspector, SettableFloatObjectInspector, SettableHiveDecimalObjectInspector, SettableHiveVarcharObjectInspector, SettableIntObjectInspector, SettableLongObjectInspector, SettableShortObjectInspector, SettableStringObjectInspector, SettableTimestampObjectInspector, ShortObjectInspector, StringObjectInspector, TimestampObjectInspector, VoidObjectInspector
All Known Implementing Classes:
AbstractPrimitiveJavaObjectInspector, AbstractPrimitiveLazyObjectInspector, AbstractPrimitiveObjectInspector, AbstractPrimitiveWritableObjectInspector, JavaBinaryObjectInspector, JavaBooleanObjectInspector, JavaByteObjectInspector, JavaDateObjectInspector, JavaDoubleObjectInspector, JavaFloatObjectInspector, JavaHiveDecimalObjectInspector, JavaHiveVarcharObjectInspector, JavaIntObjectInspector, JavaLongObjectInspector, JavaShortObjectInspector, JavaStringObjectInspector, JavaTimestampObjectInspector, JavaVoidObjectInspector, LazyBinaryObjectInspector, LazyBooleanObjectInspector, LazyByteObjectInspector, LazyDateObjectInspector, LazyDoubleObjectInspector, LazyFloatObjectInspector, LazyHiveDecimalObjectInspector, LazyHiveVarcharObjectInspector, LazyIntObjectInspector, LazyLongObjectInspector, LazyShortObjectInspector, LazyStringObjectInspector, LazyTimestampObjectInspector, LazyVoidObjectInspector, WritableBinaryObjectInspector, WritableBooleanObjectInspector, WritableByteObjectInspector, WritableConstantBinaryObjectInspector, WritableConstantBooleanObjectInspector, WritableConstantByteObjectInspector, WritableConstantDateObjectInspector, WritableConstantDoubleObjectInspector, WritableConstantFloatObjectInspector, WritableConstantHiveDecimalObjectInspector, WritableConstantHiveVarcharObjectInspector, WritableConstantIntObjectInspector, WritableConstantLongObjectInspector, WritableConstantShortObjectInspector, WritableConstantStringObjectInspector, WritableConstantTimestampObjectInspector, WritableDateObjectInspector, WritableDoubleObjectInspector, WritableFloatObjectInspector, WritableHiveDecimalObjectInspector, WritableHiveVarcharObjectInspector, WritableIntObjectInspector, WritableLongObjectInspector, WritableShortObjectInspector, WritableStringObjectInspector, WritableTimestampObjectInspector, WritableVoidObjectInspector

public interface PrimitiveObjectInspector
extends ObjectInspector, PrimitiveTypeSpec

PrimitiveObjectInspector.


Nested Class Summary
static class PrimitiveObjectInspector.PrimitiveCategory
          The primitive types supported by Hive.
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector
ObjectInspector.Category
 
Method Summary
 Object copyObject(Object o)
          Get a copy of the Object in the same class, so the return value can be stored independently of the parameter.
 Class<?> getJavaPrimitiveClass()
          Get the Java Primitive class which is the return type of getJavaPrimitiveObject().
 PrimitiveObjectInspector.PrimitiveCategory getPrimitiveCategory()
          Get the primitive category of the PrimitiveObjectInspector.
 Object getPrimitiveJavaObject(Object o)
          Get the Java Primitive object.
 Class<?> getPrimitiveWritableClass()
          Get the Primitive Writable class which is the return type of getPrimitiveWritableObject() and copyToPrimitiveWritableObject().
 Object getPrimitiveWritableObject(Object o)
          Return the data in an instance of primitive writable Object.
 BaseTypeParams getTypeParams()
          If the type has type parameters (such as varchar length, or decimal precision/scale), then return the parameters for the type.
 boolean preferWritable()
          Whether the ObjectInspector prefers to return a Primitive Writable Object instead of a Primitive Java Object.
 void setTypeParams(BaseTypeParams newParams)
          Set the type parameters for the type.
 
Methods inherited from interface org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector
getCategory, getTypeName
 

Method Detail

getPrimitiveCategory

PrimitiveObjectInspector.PrimitiveCategory getPrimitiveCategory()
Get the primitive category of the PrimitiveObjectInspector.

Specified by:
getPrimitiveCategory in interface PrimitiveTypeSpec
Returns:
PrimitiveCategory referred to by the PrimitiveTypeSpec

getPrimitiveWritableClass

Class<?> getPrimitiveWritableClass()
Get the Primitive Writable class which is the return type of getPrimitiveWritableObject() and copyToPrimitiveWritableObject().


getPrimitiveWritableObject

Object getPrimitiveWritableObject(Object o)
Return the data in an instance of primitive writable Object. If the Object is already a primitive writable Object, just return o.


getJavaPrimitiveClass

Class<?> getJavaPrimitiveClass()
Get the Java Primitive class which is the return type of getJavaPrimitiveObject().


getPrimitiveJavaObject

Object getPrimitiveJavaObject(Object o)
Get the Java Primitive object.


copyObject

Object copyObject(Object o)
Get a copy of the Object in the same class, so the return value can be stored independently of the parameter. If the Object is a Primitive Java Object, we just return the parameter since Primitive Java Object is immutable.


preferWritable

boolean preferWritable()
Whether the ObjectInspector prefers to return a Primitive Writable Object instead of a Primitive Java Object. This can be useful for determining the most efficient way to getting data out of the Object.


getTypeParams

BaseTypeParams getTypeParams()
If the type has type parameters (such as varchar length, or decimal precision/scale), then return the parameters for the type.

Specified by:
getTypeParams in interface PrimitiveTypeSpec
Returns:
A BaseTypeParams object representing the parameters for the type, or null

setTypeParams

void setTypeParams(BaseTypeParams newParams)
Set the type parameters for the type.

Parameters:
newParams - type parameters for the type


Copyright © 2012 The Apache Software Foundation