org.apache.hadoop.hive.serde2
Class MetadataTypedColumnsetSerDe

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

public class MetadataTypedColumnsetSerDe
extends AbstractSerDe

MetadataTypedColumnsetSerDe.


Field Summary
static String defaultNullString
           
static String DefaultSeparator
           
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
MetadataTypedColumnsetSerDe()
           
 
Method Summary
static Object deserialize(ColumnSet c, String row, String sep, String nullString, int limit)
          Split the row into columns.
 Object deserialize(Writable field)
          Deserialize an object out of a Writable blob.
 ObjectInspector getObjectInspector()
          Get the object inspector that can be used to navigate through the internal structure of the Object returned from deserialize(...).
 SerDeStats getSerDeStats()
          Returns statistics collected when serializing
 Class<? extends Writable> getSerializedClass()
          Returns the Writable class that would be returned by the serialize method.
 void initialize(Configuration job, Properties tbl)
          Initialize the HiveSerializer.
 Writable serialize(Object obj, ObjectInspector objInspector)
          Serialize an object by navigating inside the Object with the ObjectInspector.
 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

DefaultSeparator

public static final String DefaultSeparator
See Also:
Constant Field Values

defaultNullString

public static final String defaultNullString
See Also:
Constant Field Values
Constructor Detail

MetadataTypedColumnsetSerDe

public MetadataTypedColumnsetSerDe()
                            throws SerDeException
Throws:
SerDeException
Method Detail

toString

public String toString()
Overrides:
toString in class Object

initialize

public void initialize(Configuration job,
                       Properties tbl)
                throws SerDeException
Description copied from class: AbstractSerDe
Initialize the HiveSerializer.

Specified by:
initialize in interface Deserializer
Specified by:
initialize in interface Serializer
Specified by:
initialize in class AbstractSerDe
Parameters:
job - System properties
tbl - table properties
Throws:
SerDeException

deserialize

public static Object deserialize(ColumnSet c,
                                 String row,
                                 String sep,
                                 String nullString,
                                 int limit)
                          throws Exception
Split the row into columns.

Parameters:
limit - up to limit columns will be produced (the last column takes all the rest), -1 for unlimited.
Returns:
The ColumnSet object
Throws:
Exception

deserialize

public Object deserialize(Writable field)
                   throws SerDeException
Description copied from class: AbstractSerDe
Deserialize an object out of a Writable blob. In most cases, the return value of this function will be constant since the function will reuse the returned object. If the client wants to keep a copy of the object, the client needs to clone the returned value by calling ObjectInspectorUtils.getStandardObject().

Specified by:
deserialize in interface Deserializer
Specified by:
deserialize in class AbstractSerDe
Parameters:
field - 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
Description copied from class: AbstractSerDe
Get the object inspector that can be used to navigate through the internal structure of the Object returned from deserialize(...).

Specified by:
getObjectInspector in interface Deserializer
Specified by:
getObjectInspector in class AbstractSerDe
Throws:
SerDeException

getSerializedClass

public Class<? extends Writable> getSerializedClass()
Description copied from class: AbstractSerDe
Returns the Writable class that would be returned by the serialize method. This is used to initialize SequenceFile header.

Specified by:
getSerializedClass in interface Serializer
Specified by:
getSerializedClass in class AbstractSerDe

serialize

public Writable serialize(Object obj,
                          ObjectInspector objInspector)
                   throws SerDeException
Description copied from class: AbstractSerDe
Serialize an object by navigating inside the Object with the ObjectInspector. In most cases, the return value of this function will be constant since the function will reuse the Writable object. If the client wants to keep a copy of the Writable, the client needs to clone the returned value.

Specified by:
serialize in interface Serializer
Specified by:
serialize in class AbstractSerDe
Throws:
SerDeException

getSerDeStats

public SerDeStats getSerDeStats()
Description copied from class: AbstractSerDe
Returns statistics collected when serializing

Specified by:
getSerDeStats in interface Deserializer
Specified by:
getSerDeStats in interface Serializer
Specified by:
getSerDeStats in class AbstractSerDe


Copyright © 2012 The Apache Software Foundation