public class AvroSerDe extends AbstractSerDe
Modifier and Type | Field and Description |
---|---|
static String |
AVRO_INT_TYPE_NAME |
static String |
AVRO_LONG_TYPE_NAME |
static String |
AVRO_PROP_LOGICAL_TYPE |
static String |
AVRO_PROP_MAX_LENGTH |
static String |
AVRO_PROP_PRECISION |
static String |
AVRO_PROP_SCALE |
static String |
AVRO_STRING_TYPE_NAME |
static String |
CHAR_TYPE_NAME |
static String |
DATE_TYPE_NAME |
static String |
DECIMAL_TYPE_NAME |
static String |
LIST_COLUMN_COMMENTS |
static String |
TABLE_COMMENT |
static String |
TABLE_NAME |
static String |
TIMESTAMP_TYPE_NAME |
static String |
VARCHAR_TYPE_NAME |
configErrors
Constructor and Description |
---|
AvroSerDe() |
Modifier and Type | Method and Description |
---|---|
Object |
deserialize(org.apache.hadoop.io.Writable writable)
Deserialize an object out of a Writable blob.
|
org.apache.avro.Schema |
determineSchemaOrReturnErrorSchema(org.apache.hadoop.conf.Configuration conf,
Properties props)
Attempt to determine the schema via the usual means, but do not throw
an exception if we fail.
|
ObjectInspector |
getObjectInspector()
Get the object inspector that can be used to navigate through the internal
structure of the Object returned from deserialize(...).
|
static org.apache.avro.Schema |
getSchemaFromCols(Properties properties,
List<String> columnNames,
List<TypeInfo> columnTypes,
String columnCommentProperty) |
SerDeStats |
getSerDeStats()
Returns statistics collected when serializing
|
Class<? extends org.apache.hadoop.io.Writable> |
getSerializedClass()
Returns the Writable class that would be returned by the serialize method.
|
void |
initialize(org.apache.hadoop.conf.Configuration configuration,
Properties properties)
Initialize the HiveSerializer.
|
void |
initialize(org.apache.hadoop.conf.Configuration configuration,
Properties tableProperties,
Properties partitionProperties)
Initialize the SerDe.
|
org.apache.hadoop.io.Writable |
serialize(Object o,
ObjectInspector objectInspector)
Serialize an object by navigating inside the Object with the
ObjectInspector.
|
getConfigurationErrors
public static final String TABLE_NAME
public static final String TABLE_COMMENT
public static final String LIST_COLUMN_COMMENTS
public static final String DECIMAL_TYPE_NAME
public static final String CHAR_TYPE_NAME
public static final String VARCHAR_TYPE_NAME
public static final String DATE_TYPE_NAME
public static final String TIMESTAMP_TYPE_NAME
public static final String AVRO_PROP_LOGICAL_TYPE
public static final String AVRO_PROP_PRECISION
public static final String AVRO_PROP_SCALE
public static final String AVRO_PROP_MAX_LENGTH
public static final String AVRO_STRING_TYPE_NAME
public static final String AVRO_INT_TYPE_NAME
public static final String AVRO_LONG_TYPE_NAME
public void initialize(org.apache.hadoop.conf.Configuration configuration, Properties tableProperties, Properties partitionProperties) throws SerDeException
AbstractSerDe
initialize
in class AbstractSerDe
configuration
- Hadoop configurationtableProperties
- Table propertiespartitionProperties
- Partition propertiesSerDeException
public void initialize(org.apache.hadoop.conf.Configuration configuration, Properties properties) throws SerDeException
AbstractSerDe
initialize
in interface Deserializer
initialize
in interface Serializer
initialize
in class AbstractSerDe
configuration
- System properties. Can be null in compile timeproperties
- table propertiesSerDeException
public static org.apache.avro.Schema getSchemaFromCols(Properties properties, List<String> columnNames, List<TypeInfo> columnTypes, String columnCommentProperty)
public org.apache.avro.Schema determineSchemaOrReturnErrorSchema(org.apache.hadoop.conf.Configuration conf, Properties props)
public Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
AbstractSerDe
getSerializedClass
in interface Serializer
getSerializedClass
in class AbstractSerDe
public org.apache.hadoop.io.Writable serialize(Object o, ObjectInspector objectInspector) throws SerDeException
AbstractSerDe
serialize
in interface Serializer
serialize
in class AbstractSerDe
SerDeException
public Object deserialize(org.apache.hadoop.io.Writable writable) throws SerDeException
AbstractSerDe
deserialize
in interface Deserializer
deserialize
in class AbstractSerDe
writable
- The Writable object containing a serialized objectSerDeException
public ObjectInspector getObjectInspector() throws SerDeException
AbstractSerDe
getObjectInspector
in interface Deserializer
getObjectInspector
in class AbstractSerDe
SerDeException
public SerDeStats getSerDeStats()
AbstractSerDe
getSerDeStats
in interface Deserializer
getSerDeStats
in interface Serializer
getSerDeStats
in class AbstractSerDe
Copyright © 2017 The Apache Software Foundation. All rights reserved.