public class LazySimpleSerDe extends AbstractSerDe
Modifier and Type | Class and Description |
---|---|
static class |
LazySimpleSerDe.SerDeParameters
SerDeParameters.
|
Modifier and Type | Field and Description |
---|---|
static byte[] |
DefaultSeparators |
static org.apache.commons.logging.Log |
LOG |
static java.lang.String |
SERIALIZATION_EXTEND_NESTING_LEVELS |
Constructor and Description |
---|
LazySimpleSerDe() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
deserialize(Writable field)
Deserialize a row from the Writable to a LazyObject.
|
static byte |
getByte(java.lang.String altValue,
byte defaultVal)
Return the byte value of the number string.
|
ObjectInspector |
getObjectInspector()
Returns the ObjectInspector for the row.
|
SerDeStats |
getSerDeStats()
Returns the statistics after (de)serialization)
|
java.lang.Class<? extends Writable> |
getSerializedClass()
Returns the Writable Class after serialization.
|
void |
initialize(Configuration job,
java.util.Properties tbl)
Initialize the SerDe given the parameters.
|
static LazySimpleSerDe.SerDeParameters |
initSerdeParams(Configuration job,
java.util.Properties tbl,
java.lang.String serdeName) |
static void |
serialize(ByteStream.Output out,
java.lang.Object obj,
ObjectInspector objInspector,
byte[] separators,
int level,
Text nullSequence,
boolean escaped,
byte escapeChar,
boolean[] needsEscape)
Serialize the row into the StringBuilder.
|
Writable |
serialize(java.lang.Object obj,
ObjectInspector objInspector)
Serialize a row of data.
|
protected void |
serializeField(ByteStream.Output out,
java.lang.Object obj,
ObjectInspector objInspector,
LazySimpleSerDe.SerDeParameters serdeParams) |
java.lang.String |
toString() |
public static final org.apache.commons.logging.Log LOG
public static final java.lang.String SERIALIZATION_EXTEND_NESTING_LEVELS
public static final byte[] DefaultSeparators
public LazySimpleSerDe() throws SerDeException
SerDeException
public java.lang.String toString()
toString
in class java.lang.Object
public static byte getByte(java.lang.String altValue, byte defaultVal)
altValue
- The string containing a number.defaultVal
- If the altValue does not represent a number, return the
defaultVal.public void initialize(Configuration job, java.util.Properties tbl) throws SerDeException
initialize
in interface Deserializer
initialize
in interface Serializer
initialize
in class AbstractSerDe
job
- System propertiestbl
- table propertiesSerDeException
Deserializer.initialize(Configuration, Properties)
public static LazySimpleSerDe.SerDeParameters initSerdeParams(Configuration job, java.util.Properties tbl, java.lang.String serdeName) throws SerDeException
SerDeException
public java.lang.Object deserialize(Writable field) throws SerDeException
deserialize
in interface Deserializer
deserialize
in class AbstractSerDe
field
- the Writable that contains the dataSerDeException
Deserializer.deserialize(Writable)
public ObjectInspector getObjectInspector() throws SerDeException
getObjectInspector
in interface Deserializer
getObjectInspector
in class AbstractSerDe
SerDeException
public java.lang.Class<? extends Writable> getSerializedClass()
getSerializedClass
in interface Serializer
getSerializedClass
in class AbstractSerDe
Serializer.getSerializedClass()
public Writable serialize(java.lang.Object obj, ObjectInspector objInspector) throws SerDeException
serialize
in interface Serializer
serialize
in class AbstractSerDe
obj
- The row objectobjInspector
- The ObjectInspector for the row objectjava.io.IOException
SerDeException
Serializer.serialize(Object, ObjectInspector)
protected void serializeField(ByteStream.Output out, java.lang.Object obj, ObjectInspector objInspector, LazySimpleSerDe.SerDeParameters serdeParams) throws SerDeException
SerDeException
public static void serialize(ByteStream.Output out, java.lang.Object obj, ObjectInspector objInspector, byte[] separators, int level, Text nullSequence, boolean escaped, byte escapeChar, boolean[] needsEscape) throws java.io.IOException, SerDeException
out
- The StringBuilder to store the serialized data.obj
- The object for the current field.objInspector
- The ObjectInspector for the current Object.separators
- The separators array.level
- The current level of separator.nullSequence
- The byte sequence representing the NULL value.escaped
- Whether we need to escape the data when writing outescapeChar
- Which char to use as the escape char, e.g. '\\'needsEscape
- Which chars needs to be escaped. This array should have size of
128. Negative byte values (or byte values >= 128) are never
escaped.java.io.IOException
SerDeException
public SerDeStats getSerDeStats()
getSerDeStats
in interface Deserializer
getSerDeStats
in interface Serializer
getSerDeStats
in class AbstractSerDe
Copyright © 2012 The Apache Software Foundation