org.apache.hadoop.hive.serde2.lazy
Class LazyFactory

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.lazy.LazyFactory

public final class LazyFactory
extends Object

LazyFactory.


Method Summary
static ObjectInspector createColumnarStructInspector(List<String> columnNames, List<TypeInfo> columnTypes, byte[] separators, Text nullSequence, boolean escaped, byte escapeChar)
          Create a hierarchical ObjectInspector for ColumnarStruct with the given columnNames and columnTypeInfos.
static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi)
          Create a hierarchical LazyObject based on the given typeInfo.
static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi, boolean typeBinary)
          Creates a LazyObject based on the LazyObjectInspector.
static ObjectInspector createLazyObjectInspector(TypeInfo typeInfo, byte[] separator, int separatorIndex, Text nullSequence, boolean escaped, byte escapeChar)
          Create a hierarchical ObjectInspector for LazyObject with the given typeInfo.
static LazyPrimitive<? extends ObjectInspector,? extends Writable> createLazyPrimitiveBinaryClass(PrimitiveObjectInspector poi)
           
static LazyPrimitive<? extends ObjectInspector,? extends Writable> createLazyPrimitiveClass(PrimitiveObjectInspector oi)
          Create a lazy primitive class given the type name.
static LazyPrimitive<? extends ObjectInspector,? extends Writable> createLazyPrimitiveClass(PrimitiveObjectInspector poi, boolean typeBinary)
          Create a lazy primitive object instance given a primitive object inspector based on it's type.
static ObjectInspector createLazyStructInspector(List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar)
          Create a hierarchical ObjectInspector for LazyStruct with the given columnNames and columnTypeInfos.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createLazyPrimitiveClass

public static LazyPrimitive<? extends ObjectInspector,? extends Writable> createLazyPrimitiveClass(PrimitiveObjectInspector poi,
                                                                                                   boolean typeBinary)
Create a lazy primitive object instance given a primitive object inspector based on it's type. It takes a boolean switch to decide whether to return a binary or standard variant of the lazy object.

Parameters:
poi - PrimitiveObjectInspector
typeBinary - a switch to return either a LazyPrimtive class or it's binary companion
Returns:
LazyPrimitive

createLazyPrimitiveClass

public static LazyPrimitive<? extends ObjectInspector,? extends Writable> createLazyPrimitiveClass(PrimitiveObjectInspector oi)
Create a lazy primitive class given the type name.


createLazyPrimitiveBinaryClass

public static LazyPrimitive<? extends ObjectInspector,? extends Writable> createLazyPrimitiveBinaryClass(PrimitiveObjectInspector poi)

createLazyObject

public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi)
Create a hierarchical LazyObject based on the given typeInfo.


createLazyObject

public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi,
                                                                     boolean typeBinary)
Creates a LazyObject based on the LazyObjectInspector. Will create binary variants for primitive objects when the switch typeBinary is specified as true.

Parameters:
oi - ObjectInspector
typeBinary - Boolean value used as switch to return variants of LazyPrimitive objects which are initialized from a binary format for the data.
Returns:
LazyObject

createLazyObjectInspector

public static ObjectInspector createLazyObjectInspector(TypeInfo typeInfo,
                                                        byte[] separator,
                                                        int separatorIndex,
                                                        Text nullSequence,
                                                        boolean escaped,
                                                        byte escapeChar)
                                                 throws SerDeException
Create a hierarchical ObjectInspector for LazyObject with the given typeInfo.

Parameters:
typeInfo - The type information for the LazyObject
separator - The array of separators for delimiting each level
separatorIndex - The current level (for separators). List(array), struct uses 1 level of separator, and map uses 2 levels: the first one for delimiting entries, the second one for delimiting key and values.
nullSequence - The sequence of bytes representing NULL.
Returns:
The ObjectInspector
Throws:
SerDeException

createLazyStructInspector

public static ObjectInspector createLazyStructInspector(List<String> columnNames,
                                                        List<TypeInfo> typeInfos,
                                                        byte[] separators,
                                                        Text nullSequence,
                                                        boolean lastColumnTakesRest,
                                                        boolean escaped,
                                                        byte escapeChar)
                                                 throws SerDeException
Create a hierarchical ObjectInspector for LazyStruct with the given columnNames and columnTypeInfos.

Parameters:
lastColumnTakesRest - whether the last column of the struct should take the rest of the row if there are extra fields.
Throws:
SerDeException
See Also:
createLazyObjectInspector(TypeInfo, byte[], int, Text, boolean, byte)

createColumnarStructInspector

public static ObjectInspector createColumnarStructInspector(List<String> columnNames,
                                                            List<TypeInfo> columnTypes,
                                                            byte[] separators,
                                                            Text nullSequence,
                                                            boolean escaped,
                                                            byte escapeChar)
                                                     throws SerDeException
Create a hierarchical ObjectInspector for ColumnarStruct with the given columnNames and columnTypeInfos.

Throws:
SerDeException
See Also:
createLazyObjectInspector(TypeInfo, byte[], int, Text, boolean, byte)


Copyright © 2012 The Apache Software Foundation