org.apache.hadoop.hive.serde2.lazybinary
Class LazyBinarySerDe

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

public class LazyBinarySerDe
extends Object
implements SerDe

The LazyBinarySerDe class combines the lazy property of LazySimpleSerDe class and the binary property of BinarySortable class. Lazy means a field is not deserialized until required. Binary means a field is serialized in binary compact format.


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
LazyBinarySerDe()
           
 
Method Summary
 Object deserialize(org.apache.hadoop.io.Writable field)
          Deserialize a table record to a lazybinary struct.
 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 conf, Properties tbl)
          Initialize the SerDe with configuration and table information.
 org.apache.hadoop.io.Writable serialize(Object obj, ObjectInspector objInspector)
          Serialize an object to a byte buffer in a binary compact way.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

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

LazyBinarySerDe

public LazyBinarySerDe()
                throws SerDeException
Throws:
SerDeException
Method Detail

initialize

public void initialize(org.apache.hadoop.conf.Configuration conf,
                       Properties tbl)
                throws SerDeException
Initialize the SerDe with configuration and table information.

Specified by:
initialize in interface Deserializer
Specified by:
initialize in interface Serializer
Parameters:
conf - System properties
tbl - table properties
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

deserialize

public Object deserialize(org.apache.hadoop.io.Writable field)
                   throws SerDeException
Deserialize a table record to a lazybinary struct.

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

serialize

public org.apache.hadoop.io.Writable serialize(Object obj,
                                               ObjectInspector objInspector)
                                        throws SerDeException
Serialize an object to a byte buffer in a binary compact way.

Specified by:
serialize in interface Serializer
Throws:
SerDeException


Copyright © 2011 The Apache Software Foundation