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

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

public class LazySimpleSerDe
extends Object
implements SerDe

LazySimpleSerDe can be used to read the same data format as MetadataTypedColumnsetSerDe and TCTLSeparatedProtocol. However, LazySimpleSerDe creates Objects in a lazy way, to provide better performance. Also LazySimpleSerDe outputs typed columns instead of treating all columns as String like MetadataTypedColumnsetSerDe.


Field Summary
static byte[] DefaultSeparators
           
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
LazySimpleSerDe()
           
 
Method Summary
 Object deserialize(org.apache.hadoop.io.Writable field)
          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

DefaultSeparators

public static final byte[] DefaultSeparators
Constructor Detail

LazySimpleSerDe

public LazySimpleSerDe()
                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. serialization.format: separator char or byte code (only supports byte-value up to 127) columns: ","-separated column names columns.types: ",", ":", or ";"-separated column types

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 field)
                   throws SerDeException
Deserialize a row from the Writable to a LazyObject.

Specified by:
deserialize in interface Deserializer
Parameters:
field - the Writable that contains the data
Returns:
The deserialized row Object.
Throws:
SerDeException
See Also:
Deserializer.deserialize(Writable)

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 © 2009 The Apache Software Foundation