public class LazyBinarySerDe extends AbstractSerDe
Modifier and Type | Class and Description |
---|---|
static class |
LazyBinarySerDe.BooleanRef |
static class |
LazyBinarySerDe.StringWrapper |
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
configErrors
Constructor and Description |
---|
LazyBinarySerDe() |
Modifier and Type | Method and Description |
---|---|
Object |
deserialize(org.apache.hadoop.io.Writable field)
Deserialize a table record to a lazybinary struct.
|
ObjectInspector |
getObjectInspector()
Returns the ObjectInspector for the row.
|
SerDeStats |
getSerDeStats()
Returns the statistics after (de)serialization)
|
Class<? extends org.apache.hadoop.io.Writable> |
getSerializedClass()
Returns the Writable Class after serialization.
|
void |
initialize(org.apache.hadoop.conf.Configuration conf,
Properties tbl)
Initialize the SerDe with configuration and table information.
|
static void |
serialize(ByteStream.RandomAccessOutput byteStream,
Object obj,
ObjectInspector objInspector,
boolean skipLengthPrefix,
LazyBinarySerDe.BooleanRef warnedOnceNullMapKey)
A recursive function that serialize an object to a byte buffer based on its
object inspector.
|
org.apache.hadoop.io.Writable |
serialize(Object obj,
ObjectInspector objInspector)
Serialize an object to a byte buffer in a binary compact way.
|
static void |
serializeStruct(ByteStream.RandomAccessOutput byteStream,
Object[] fieldData,
List<ObjectInspector> fieldOis) |
protected static void |
serializeText(ByteStream.RandomAccessOutput byteStream,
org.apache.hadoop.io.Text t,
boolean skipLengthPrefix) |
static void |
setFromBigIntegerBytesAndScale(byte[] bytes,
int offset,
int length,
org.apache.hadoop.hive.serde2.io.HiveDecimalWritable dec) |
static void |
writeDateToByteStream(ByteStream.RandomAccessOutput byteStream,
DateWritableV2 date) |
protected static void |
writeSizeAtOffset(ByteStream.RandomAccessOutput byteStream,
int byteSizeStart,
int size) |
static void |
writeToByteStream(ByteStream.RandomAccessOutput byteStream,
org.apache.hadoop.hive.common.type.HiveDecimal dec,
long[] scratchLongs,
byte[] scratchBytes)
Allocate scratchLongs with HiveDecimal.SCRATCH_LONGS_LEN longs.
|
static void |
writeToByteStream(ByteStream.RandomAccessOutput byteStream,
org.apache.hadoop.hive.serde2.io.HiveDecimalWritable decWritable) |
static void |
writeToByteStream(ByteStream.RandomAccessOutput byteStream,
org.apache.hadoop.hive.serde2.io.HiveDecimalWritable decWritable,
long[] scratchLongs,
byte[] scratchBytes)
Allocate scratchLongs with HiveDecimal.SCRATCH_LONGS_LEN longs.
|
getConfigurationErrors, initialize, shouldStoreFieldsInMetastore
public LazyBinarySerDe() throws SerDeException
SerDeException
public void initialize(org.apache.hadoop.conf.Configuration conf, Properties tbl) throws SerDeException
initialize
in interface Deserializer
initialize
in interface Serializer
initialize
in class AbstractSerDe
conf
- System properties. Can be null in compile timetbl
- table propertiesSerDeException
public ObjectInspector getObjectInspector() throws SerDeException
getObjectInspector
in interface Deserializer
getObjectInspector
in class AbstractSerDe
SerDeException
public Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
getSerializedClass
in interface Serializer
getSerializedClass
in class AbstractSerDe
public Object deserialize(org.apache.hadoop.io.Writable field) throws SerDeException
deserialize
in interface Deserializer
deserialize
in class AbstractSerDe
field
- The Writable object containing a serialized objectSerDeException
public org.apache.hadoop.io.Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException
serialize
in interface Serializer
serialize
in class AbstractSerDe
SerDeException
public static void serializeStruct(ByteStream.RandomAccessOutput byteStream, Object[] fieldData, List<ObjectInspector> fieldOis) throws SerDeException
SerDeException
protected static void serializeText(ByteStream.RandomAccessOutput byteStream, org.apache.hadoop.io.Text t, boolean skipLengthPrefix)
public static void writeDateToByteStream(ByteStream.RandomAccessOutput byteStream, DateWritableV2 date)
public static void setFromBigIntegerBytesAndScale(byte[] bytes, int offset, int length, org.apache.hadoop.hive.serde2.io.HiveDecimalWritable dec)
public static void writeToByteStream(ByteStream.RandomAccessOutput byteStream, org.apache.hadoop.hive.serde2.io.HiveDecimalWritable decWritable)
public static void writeToByteStream(ByteStream.RandomAccessOutput byteStream, org.apache.hadoop.hive.common.type.HiveDecimal dec, long[] scratchLongs, byte[] scratchBytes)
byteStream
- dec
- scratchLongs
- scratchBytes
- public static void writeToByteStream(ByteStream.RandomAccessOutput byteStream, org.apache.hadoop.hive.serde2.io.HiveDecimalWritable decWritable, long[] scratchLongs, byte[] scratchBytes)
byteStream
- decWritable
- scratchLongs
- scratchBytes
- public static void serialize(ByteStream.RandomAccessOutput byteStream, Object obj, ObjectInspector objInspector, boolean skipLengthPrefix, LazyBinarySerDe.BooleanRef warnedOnceNullMapKey) throws SerDeException
byteStream
- the byte stream storing the serialization dataobj
- the object to serializeobjInspector
- the object inspectorskipLengthPrefix
- a boolean indicating whether length prefix is
needed for list/map/structwarnedOnceNullMapKey
- a boolean indicating whether a warning
has been issued once already when encountering null map keysSerDeException
protected static void writeSizeAtOffset(ByteStream.RandomAccessOutput byteStream, int byteSizeStart, int size)
public SerDeStats getSerDeStats()
getSerDeStats
in interface Deserializer
getSerDeStats
in interface Serializer
getSerDeStats
in class AbstractSerDe
Copyright © 2022 The Apache Software Foundation. All rights reserved.