org.apache.hadoop.hive.serde2
Interface Serializer

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

public interface Serializer

HiveSerializer is used to serialize data to a Hadoop Writable object. The serialize In addition to the interface below, all implementations are assume to have a ctor that takes a single 'Table' object as argument.


Method Summary
 SerDeStats getSerDeStats()
          Returns statistics collected when serializing
 Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
          Returns the Writable class that would be returned by the serialize method.
 void initialize(org.apache.hadoop.conf.Configuration conf, Properties tbl)
          Initialize the HiveSerializer.
 org.apache.hadoop.io.Writable serialize(Object obj, ObjectInspector objInspector)
          Serialize an object by navigating inside the Object with the ObjectInspector.
 

Method Detail

initialize

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

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

getSerializedClass

Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
Returns the Writable class that would be returned by the serialize method. This is used to initialize SequenceFile header.


serialize

org.apache.hadoop.io.Writable serialize(Object obj,
                                        ObjectInspector objInspector)
                                        throws SerDeException
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.

Throws:
SerDeException

getSerDeStats

SerDeStats getSerDeStats()
Returns statistics collected when serializing



Copyright © 2013 The Apache Software Foundation