org.apache.hadoop.hive.serde2
Interface Deserializer

All Known Subinterfaces:
SerDe
All Known Implementing Classes:
AvroSerDe, BinarySortableSerDe, ByteStreamTypedSerDe, ColumnarSerDe, ColumnarSerDeBase, DelimitedJSONSerDe, DynamicSerDe, LazyBinaryColumnarSerDe, LazyBinarySerDe, LazySimpleSerDe, MetadataTypedColumnsetSerDe, NullStructSerDe, RegexSerDe, TestSerDe, ThriftByteStreamTypedSerDe, ThriftDeserializer, TypedSerDe

public interface Deserializer

HiveDeserializer is used to deserialize the data from hadoop Writable to a custom java object that can be of any type that the developer wants. HiveDeserializer also provides the ObjectInspector which can be used to inspect the internal structure of the object (that is returned by deserialize function).


Method Summary
 Object deserialize(org.apache.hadoop.io.Writable blob)
          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
 void initialize(org.apache.hadoop.conf.Configuration conf, Properties tbl)
          Initialize the HiveDeserializer.
 

Method Detail

initialize

void initialize(org.apache.hadoop.conf.Configuration conf,
                Properties tbl)
                throws SerDeException
Initialize the HiveDeserializer.

Parameters:
conf - System properties
tbl - table properties
Throws:
SerDeException

deserialize

Object deserialize(org.apache.hadoop.io.Writable blob)
                   throws SerDeException
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().

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

getObjectInspector

ObjectInspector getObjectInspector()
                                   throws SerDeException
Get the object inspector that can be used to navigate through the internal structure of the Object returned from deserialize(...).

Throws:
SerDeException

getSerDeStats

SerDeStats getSerDeStats()
Returns statistics collected when serializing



Copyright © 2013 The Apache Software Foundation