|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hive.serde2.binarysortable.BinarySortableSerDe
public class BinarySortableSerDe
BinarySortableSerDe can be used to write data in a way that the data can be compared byte-by-byte with the same order. The data format: NULL: a single byte \0 NON-NULL Primitives: ALWAYS prepend a single byte \1, and then: Boolean: FALSE = \1, TRUE = \2 Byte: flip the sign-bit to make sure negative comes before positive Short: flip the sign-bit to make sure negative comes before positive Int: flip the sign-bit to make sure negative comes before positive Long: flip the sign-bit to make sure negative comes before positive Double: flip the sign-bit for positive double, and all bits for negative double values String: NULL-terminated UTF-8 string, with NULL escaped to \1 \1, and \1 escaped to \1 \2 NON-NULL Complex Types: ALWAYS prepend a single byte \1, and then: Struct: one field by one field. List: \1 followed by each element, and \0 to terminate Map: \1 followed by each key and then each value, and \0 to terminate This SerDe takes an additional parameter SERIALIZATION_SORT_ORDER which is a string containing only "+" and "-". The length of the string should equal to the number of fields in the top-level struct for serialization. "+" means the field should be sorted ascendingly, and "-" means descendingly. The sub fields in the same top-level field will have the same sort order.
| Field Summary | |
|---|---|
static org.apache.commons.logging.Log |
LOG
|
| Constructor Summary | |
|---|---|
BinarySortableSerDe()
|
|
| 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 |
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 HiveDeserializer. |
org.apache.hadoop.io.Writable |
serialize(Object obj,
ObjectInspector objInspector)
Serialize an object by navigating inside the Object with the ObjectInspector. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.commons.logging.Log LOG
| Constructor Detail |
|---|
public BinarySortableSerDe()
| Method Detail |
|---|
public void initialize(org.apache.hadoop.conf.Configuration conf,
Properties tbl)
throws SerDeException
Deserializer
initialize in interface Deserializerinitialize in interface Serializerconf - System propertiestbl - table properties
SerDeExceptionpublic Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
Serializer
getSerializedClass in interface Serializer
public ObjectInspector getObjectInspector()
throws SerDeException
Deserializer
getObjectInspector in interface DeserializerSerDeException
public Object deserialize(org.apache.hadoop.io.Writable blob)
throws SerDeException
Deserializer
deserialize in interface Deserializerblob - The Writable object containing a serialized object
SerDeException
public org.apache.hadoop.io.Writable serialize(Object obj,
ObjectInspector objInspector)
throws SerDeException
Serializer
serialize in interface SerializerSerDeExceptionpublic SerDeStats getSerDeStats()
Deserializer
getSerDeStats in interface DeserializergetSerDeStats in interface Serializer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||