public class JsonSerDe extends AbstractSerDe
{"name="john","age"=30}
{"name="sue","age"=32}
Modifier and Type | Field and Description |
---|---|
static String |
BINARY_FORMAT |
static String |
IGNORE_EXTRA |
static String |
NULL_EMPTY_LINES |
static String |
STRINGIFY_COMPLEX |
configuration, log, partitionProperties, properties, tableProperties
Constructor and Description |
---|
JsonSerDe() |
Modifier and Type | Method and Description |
---|---|
Object |
deserialize(org.apache.hadoop.io.Writable blob)
Deserialize an object out of a Writable blob containing JSON text.
|
BinaryEncoding |
getBinaryEncoding() |
ObjectInspector |
getObjectInspector()
Returns an object inspector for the specified schema that is capable of
reading in the object representation of the JSON string.
|
Class<? extends org.apache.hadoop.io.Writable> |
getSerializedClass()
Returns the Writable class that would be returned by the serialize method.
|
StructTypeInfo |
getTypeInfo() |
void |
initialize(org.apache.hadoop.conf.Configuration configuration,
Properties tableProperties,
Properties partitionProperties)
Initialize the SerDe.
|
void |
initialize(org.apache.hadoop.conf.Configuration configuration,
Properties tableProperties,
Properties partitionProperties,
boolean writeablePrimitivesDeserialize)
Initialize the SerDe.
|
boolean |
isNullEmptyLines() |
org.apache.hadoop.io.Writable |
serialize(Object obj,
ObjectInspector objInspector)
Given an object and object inspector pair, traverse the object
and generate a Text representation of the object.
|
getColumnComments, getColumnNames, getColumnTypes, getConfiguration, getPartitionColumnComments, getPartitionColumnNames, getPartitionColumnTypes, getSerDeStats, parseColumnComments, parseColumnNames, parseColumnNames, parseColumnTypes, parseColumnTypes, shouldStoreFieldsInMetastore, toString
public static final String BINARY_FORMAT
public static final String STRINGIFY_COMPLEX
public static final String IGNORE_EXTRA
public static final String NULL_EMPTY_LINES
public void initialize(org.apache.hadoop.conf.Configuration configuration, Properties tableProperties, Properties partitionProperties) throws SerDeException
initialize
in class AbstractSerDe
configuration
- Hadoop configurationtableProperties
- Table propertiespartitionProperties
- Partition properties (may be null
if
table has no partitions)NullPointerException
- if tableProperties is null
SerDeException
- if SerDe fails to initializepublic void initialize(org.apache.hadoop.conf.Configuration configuration, Properties tableProperties, Properties partitionProperties, boolean writeablePrimitivesDeserialize) throws SerDeException
configuration
- Hadoop configurationtableProperties
- Table propertiespartitionProperties
- Partition properties (may be null
if
table has no partitions)writeablePrimitivesDeserialize
- true if outputs are Hadoop WritableNullPointerException
- if tableProperties is null
SerDeException
- if SerDe fails to initializepublic Object deserialize(org.apache.hadoop.io.Writable blob) throws SerDeException
deserialize
in interface Deserializer
deserialize
in class AbstractSerDe
blob
- The Writable (Text) 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 ObjectInspector getObjectInspector() throws SerDeException
SerDeException
public Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
AbstractSerDe
getSerializedClass
in interface Serializer
getSerializedClass
in class AbstractSerDe
public StructTypeInfo getTypeInfo()
public BinaryEncoding getBinaryEncoding()
public boolean isNullEmptyLines()
Copyright © 2022 The Apache Software Foundation. All rights reserved.