|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.serde2.AbstractSerDe
org.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
|
static String |
SERIALIZATION_EXTEND_NESTING_LEVELS
|
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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
public static final String SERIALIZATION_EXTEND_NESTING_LEVELS
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 Deserializer
initialize
in interface Serializer
initialize
in class AbstractSerDe
job
- System propertiestbl
- table properties
SerDeException
Deserializer.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 Deserializer
deserialize
in class AbstractSerDe
field
- the Writable that contains the data
SerDeException
Deserializer.deserialize(Writable)
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
Serializer.getSerializedClass()
public org.apache.hadoop.io.Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException
serialize
in interface Serializer
serialize
in class AbstractSerDe
obj
- The row objectobjInspector
- The ObjectInspector for the row object
IOException
SerDeException
Serializer.serialize(Object, ObjectInspector)
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, 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.
IOException
SerDeException
public SerDeStats getSerDeStats()
getSerDeStats
in interface Deserializer
getSerDeStats
in interface Serializer
getSerDeStats
in class AbstractSerDe
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |