|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
public class LazySimpleSerDe
LazySimpleSerDe can be used to read the same data format as MetadataTypedColumnsetSerDe and TCTLSeparatedProtocol. However, LazySimpleSerDe creates Objects in a lazy way, to provide better performance. Also LazySimpleSerDe outputs typed columns instead of treating all columns as String like MetadataTypedColumnsetSerDe.
| Nested Class Summary | |
|---|---|
static class |
LazySimpleSerDe.SerDeParameters
SerDeParameters. |
| Field Summary | |
|---|---|
static byte[] |
DefaultSeparators
|
static org.apache.commons.logging.Log |
LOG
|
| Constructor Summary | |
|---|---|
LazySimpleSerDe()
|
|
| Method Summary | |
|---|---|
Object |
deserialize(org.apache.hadoop.io.Writable field)
Deserialize a row from the Writable to a LazyObject. |
static byte |
getByte(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) |
Class<? extends org.apache.hadoop.io.Writable> |
getSerializedClass()
Returns the Writable Class after serialization. |
void |
initialize(org.apache.hadoop.conf.Configuration job,
Properties tbl)
Initialize the SerDe given the parameters. |
static LazySimpleSerDe.SerDeParameters |
initSerdeParams(org.apache.hadoop.conf.Configuration job,
Properties tbl,
String serdeName)
|
static void |
serialize(ByteStream.Output out,
Object obj,
ObjectInspector objInspector,
byte[] separators,
int level,
org.apache.hadoop.io.Text nullSequence,
boolean escaped,
byte escapeChar,
boolean[] needsEscape)
Serialize the row into the StringBuilder. |
org.apache.hadoop.io.Writable |
serialize(Object obj,
ObjectInspector objInspector)
Serialize a row of data. |
protected void |
serializeField(ByteStream.Output out,
Object obj,
ObjectInspector objInspector,
LazySimpleSerDe.SerDeParameters serdeParams)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.commons.logging.Log LOG
public static final byte[] DefaultSeparators
| Constructor Detail |
|---|
public LazySimpleSerDe()
throws SerDeException
SerDeException| Method Detail |
|---|
public String toString()
toString in class Object
public static byte getByte(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(org.apache.hadoop.conf.Configuration job,
Properties tbl)
throws SerDeException
initialize in interface Deserializerinitialize in interface Serializerjob - System propertiestbl - table properties
SerDeExceptionDeserializer.initialize(Configuration, Properties)
public static LazySimpleSerDe.SerDeParameters initSerdeParams(org.apache.hadoop.conf.Configuration job,
Properties tbl,
String serdeName)
throws SerDeException
SerDeException
public Object deserialize(org.apache.hadoop.io.Writable field)
throws SerDeException
deserialize in interface Deserializerfield - the Writable that contains the data
SerDeExceptionDeserializer.deserialize(Writable)
public ObjectInspector getObjectInspector()
throws SerDeException
getObjectInspector in interface DeserializerSerDeExceptionpublic Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
getSerializedClass in interface SerializerSerializer.getSerializedClass()
public org.apache.hadoop.io.Writable serialize(Object obj,
ObjectInspector objInspector)
throws SerDeException
serialize in interface Serializerobj - The row objectobjInspector - The ObjectInspector for the row object
IOException
SerDeExceptionSerializer.serialize(Object, ObjectInspector)
protected void serializeField(ByteStream.Output out,
Object obj,
ObjectInspector objInspector,
LazySimpleSerDe.SerDeParameters serdeParams)
throws SerDeException
SerDeException
public static void serialize(ByteStream.Output out,
Object obj,
ObjectInspector objInspector,
byte[] separators,
int level,
org.apache.hadoop.io.Text nullSequence,
boolean escaped,
byte escapeChar,
boolean[] needsEscape)
throws IOException
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.
IOExceptionpublic SerDeStats getSerDeStats()
getSerDeStats in interface DeserializergetSerDeStats in interface Serializer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||