public class BinarySortableSerDe extends AbstractSerDe
Modifier and Type | Field and Description |
---|---|
static Charset |
decimalCharSet |
static org.slf4j.Logger |
LOG |
static byte |
ONE |
static byte |
ZERO |
configErrors
Constructor and Description |
---|
BinarySortableSerDe() |
Modifier and Type | Method and Description |
---|---|
Object |
deserialize(org.apache.hadoop.io.Writable blob)
Deserialize an object out of a Writable blob.
|
static org.apache.hadoop.io.Text |
deserializeText(InputByteBuffer buffer,
boolean invert,
org.apache.hadoop.io.Text r) |
byte[] |
getNotNullMarkers() |
byte[] |
getNullMarkers() |
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.
|
boolean[] |
getSortOrders() |
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.
|
static void |
serializeBytes(ByteStream.Output buffer,
byte[] data,
int length,
boolean invert) |
static void |
serializeBytes(ByteStream.Output buffer,
byte[] data,
int offset,
int length,
boolean invert) |
static void |
serializeDouble(ByteStream.Output buffer,
double vd,
boolean invert) |
static void |
serializeFloat(ByteStream.Output buffer,
float vf,
boolean invert) |
static void |
serializeHiveDecimal(ByteStream.Output buffer,
org.apache.hadoop.hive.common.type.HiveDecimal dec,
boolean invert) |
static void |
serializeHiveDecimal(ByteStream.Output buffer,
org.apache.hadoop.hive.common.type.HiveDecimal dec,
boolean invert,
byte[] scratchBuffer)
Decimals are encoded in three pieces:Decimals are encoded in three pieces:
Sign: 1, 2 or 3 for smaller, equal or larger than 0 respectively
Factor: Number that indicates the amount of digits you have to move
the decimal point left or right until the resulting number is smaller
than zero but has something other than 0 as the first digit.
|
static void |
serializeHiveDecimal(ByteStream.Output buffer,
org.apache.hadoop.hive.serde2.io.HiveDecimalWritable decWritable,
boolean invert,
byte[] scratchBuffer) |
static void |
serializeHiveIntervalDayTime(ByteStream.Output buffer,
org.apache.hadoop.hive.common.type.HiveIntervalDayTime intervalDayTime,
boolean invert) |
static void |
serializeHiveIntervalYearMonth(ByteStream.Output buffer,
HiveIntervalYearMonth intervalYearMonth,
boolean invert) |
static void |
serializeInt(ByteStream.Output buffer,
int v,
boolean invert) |
static void |
serializeLong(ByteStream.Output buffer,
long v,
boolean invert) |
static void |
serializeOldHiveDecimal(ByteStream.Output buffer,
org.apache.hadoop.hive.common.type.HiveDecimalV1 oldDec,
boolean invert) |
static void |
serializeShort(ByteStream.Output buffer,
short v,
boolean invert) |
static void |
serializeStruct(ByteStream.Output byteStream,
Object[] fieldData,
List<ObjectInspector> fieldOis,
boolean[] sortableSortOrders,
byte[] nullMarkers,
byte[] notNullMarkers) |
static void |
serializeTimestampTZWritable(ByteStream.Output buffer,
TimestampLocalTZWritable t,
boolean invert) |
static void |
serializeTimestampWritable(ByteStream.Output buffer,
TimestampWritableV2 t,
boolean invert) |
static void |
writeByte(ByteStream.RandomAccessOutput buffer,
byte b,
boolean invert) |
getConfigurationErrors, initialize, shouldStoreFieldsInMetastore
public static final org.slf4j.Logger LOG
public static final byte ZERO
public static final byte ONE
public static Charset decimalCharSet
public void initialize(org.apache.hadoop.conf.Configuration conf, Properties tbl) throws SerDeException
AbstractSerDe
initialize
in interface Deserializer
initialize
in interface Serializer
initialize
in class AbstractSerDe
conf
- System properties. Can be null in compile timetbl
- table propertiesSerDeException
public Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
AbstractSerDe
getSerializedClass
in interface Serializer
getSerializedClass
in class AbstractSerDe
public ObjectInspector getObjectInspector() throws SerDeException
AbstractSerDe
getObjectInspector
in interface Deserializer
getObjectInspector
in class AbstractSerDe
SerDeException
public Object deserialize(org.apache.hadoop.io.Writable blob) throws SerDeException
AbstractSerDe
deserialize
in interface Deserializer
deserialize
in class AbstractSerDe
blob
- The Writable object containing a serialized objectSerDeException
public static org.apache.hadoop.io.Text deserializeText(InputByteBuffer buffer, boolean invert, org.apache.hadoop.io.Text r) throws IOException
IOException
public org.apache.hadoop.io.Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException
AbstractSerDe
serialize
in interface Serializer
serialize
in class AbstractSerDe
SerDeException
public static void writeByte(ByteStream.RandomAccessOutput buffer, byte b, boolean invert)
public static void serializeBytes(ByteStream.Output buffer, byte[] data, int length, boolean invert)
public static void serializeBytes(ByteStream.Output buffer, byte[] data, int offset, int length, boolean invert)
public static void serializeShort(ByteStream.Output buffer, short v, boolean invert)
public static void serializeInt(ByteStream.Output buffer, int v, boolean invert)
public static void serializeLong(ByteStream.Output buffer, long v, boolean invert)
public static void serializeFloat(ByteStream.Output buffer, float vf, boolean invert)
public static void serializeDouble(ByteStream.Output buffer, double vd, boolean invert)
public static void serializeTimestampWritable(ByteStream.Output buffer, TimestampWritableV2 t, boolean invert)
public static void serializeTimestampTZWritable(ByteStream.Output buffer, TimestampLocalTZWritable t, boolean invert)
public static void serializeHiveIntervalYearMonth(ByteStream.Output buffer, HiveIntervalYearMonth intervalYearMonth, boolean invert)
public static void serializeHiveIntervalDayTime(ByteStream.Output buffer, org.apache.hadoop.hive.common.type.HiveIntervalDayTime intervalDayTime, boolean invert)
public static void serializeOldHiveDecimal(ByteStream.Output buffer, org.apache.hadoop.hive.common.type.HiveDecimalV1 oldDec, boolean invert)
public static void serializeHiveDecimal(ByteStream.Output buffer, org.apache.hadoop.hive.common.type.HiveDecimal dec, boolean invert)
public static void serializeHiveDecimal(ByteStream.Output buffer, org.apache.hadoop.hive.common.type.HiveDecimal dec, boolean invert, byte[] scratchBuffer)
buffer
- dec
- invert
- scratchBuffer
- public static void serializeHiveDecimal(ByteStream.Output buffer, org.apache.hadoop.hive.serde2.io.HiveDecimalWritable decWritable, boolean invert, byte[] scratchBuffer)
public SerDeStats getSerDeStats()
AbstractSerDe
getSerDeStats
in interface Deserializer
getSerDeStats
in interface Serializer
getSerDeStats
in class AbstractSerDe
public static void serializeStruct(ByteStream.Output byteStream, Object[] fieldData, List<ObjectInspector> fieldOis, boolean[] sortableSortOrders, byte[] nullMarkers, byte[] notNullMarkers) throws SerDeException
SerDeException
public boolean[] getSortOrders()
public byte[] getNullMarkers()
public byte[] getNotNullMarkers()
Copyright © 2019 The Apache Software Foundation. All rights reserved.