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
SerDeExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic 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 Deserializerinitialize in interface Serializerinitialize in class AbstractSerDejob - System propertiestbl - table propertiesSerDeExceptionDeserializer.initialize(Configuration, Properties)public static LazySimpleSerDe.SerDeParameters initSerdeParams(Configuration job, java.util.Properties tbl, java.lang.String serdeName) throws SerDeException
SerDeExceptionpublic java.lang.Object deserialize(Writable field)
throws SerDeException
deserialize in interface Deserializerdeserialize in class AbstractSerDefield - the Writable that contains the dataSerDeExceptionDeserializer.deserialize(Writable)public ObjectInspector getObjectInspector() throws SerDeException
getObjectInspector in interface DeserializergetObjectInspector in class AbstractSerDeSerDeExceptionpublic java.lang.Class<? extends Writable> getSerializedClass()
getSerializedClass in interface SerializergetSerializedClass in class AbstractSerDeSerializer.getSerializedClass()public Writable serialize(java.lang.Object obj,
ObjectInspector objInspector)
throws SerDeException
serialize in interface Serializerserialize in class AbstractSerDeobj - The row objectobjInspector - The ObjectInspector for the row objectjava.io.IOExceptionSerDeExceptionSerializer.serialize(Object, ObjectInspector)protected void serializeField(ByteStream.Output out, java.lang.Object obj, ObjectInspector objInspector, LazySimpleSerDe.SerDeParameters serdeParams) throws SerDeException
SerDeExceptionpublic 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.IOExceptionSerDeExceptionpublic SerDeStats getSerDeStats()
getSerDeStats in interface DeserializergetSerDeStats in interface SerializergetSerDeStats in class AbstractSerDeCopyright © 2012 The Apache Software Foundation