org.apache.hadoop.hive.serde2.columnar
Class ColumnarSerDe

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe
All Implemented Interfaces:
Deserializer, SerDe, Serializer

public class ColumnarSerDe
extends Object
implements SerDe

ColumnarSerDe is used for columnar based storage supported by RCFile. ColumnarSerDe differentiate from LazySimpleSerDe in:
(1) ColumnarSerDe uses a ColumnarStruct as its lazy Object
(2) ColumnarSerDe initialize ColumnarStruct's field directly. But under the field level, it works like LazySimpleSerDe


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
ColumnarSerDe()
           
 
Method Summary
 Object deserialize(org.apache.hadoop.io.Writable blob)
          Deserialize a row from the Writable to a LazyObject.
 ObjectInspector getObjectInspector()
          Returns the ObjectInspector for the row.
 Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
          Returns the Writable Class after serialization.
 void initialize(org.apache.hadoop.conf.Configuration job, Properties tbl)
          Initialize the SerDe given the parameters.
 org.apache.hadoop.io.Writable serialize(Object obj, ObjectInspector objInspector)
          Serialize a row of data.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

ColumnarSerDe

public ColumnarSerDe()
              throws SerDeException
Throws:
SerDeException
Method Detail

toString

public String toString()
Overrides:
toString in class Object

initialize

public void initialize(org.apache.hadoop.conf.Configuration job,
                       Properties tbl)
                throws SerDeException
Initialize the SerDe given the parameters.

Specified by:
initialize in interface Deserializer
Specified by:
initialize in interface Serializer
Parameters:
job - System properties
tbl - table properties
Throws:
SerDeException
See Also:
Deserializer.initialize(Configuration, Properties)

deserialize

public Object deserialize(org.apache.hadoop.io.Writable blob)
                   throws SerDeException
Deserialize a row from the Writable to a LazyObject.

Specified by:
deserialize in interface Deserializer
Parameters:
blob - The Writable object containing a serialized object
Returns:
A Java object representing the contents in the blob.
Throws:
SerDeException

getObjectInspector

public ObjectInspector getObjectInspector()
                                   throws SerDeException
Returns the ObjectInspector for the row.

Specified by:
getObjectInspector in interface Deserializer
Throws:
SerDeException

getSerializedClass

public Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
Returns the Writable Class after serialization.

Specified by:
getSerializedClass in interface Serializer
See Also:
Serializer.getSerializedClass()

serialize

public org.apache.hadoop.io.Writable serialize(Object obj,
                                               ObjectInspector objInspector)
                                        throws SerDeException
Serialize a row of data.

Specified by:
serialize in interface Serializer
Parameters:
obj - The row object
objInspector - The ObjectInspector for the row object
Returns:
The serialized Writable object
Throws:
SerDeException
See Also:
Serializer.serialize(Object, ObjectInspector)


Copyright © 2010 The Apache Software Foundation