public class AvroSerdeUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AVRO_SERDE_SCHEMA |
static java.lang.String |
EXCEPTION_MESSAGE |
static java.lang.String |
SCHEMA_LITERAL |
static java.lang.String |
SCHEMA_NONE |
static java.lang.String |
SCHEMA_URL |
Constructor and Description |
---|
AvroSerdeUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.avro.Schema |
determineSchemaOrReturnErrorSchema(java.util.Properties props)
Attempt to determine the schema via the usual means, but do not throw
an exception if we fail.
|
static org.apache.avro.Schema |
determineSchemaOrThrowException(java.util.Properties properties)
Determine the schema to that's been provided for Avro serde work.
|
static org.apache.avro.Schema |
getOtherTypeFromNullableType(org.apache.avro.Schema schema)
In a nullable type, get the schema for the non-nullable type.
|
protected static org.apache.avro.Schema |
getSchemaFromHDFS(java.lang.String schemaHDFSUrl,
Configuration conf) |
static boolean |
insideMRJob(JobConf job)
Determine if we're being executed from within an MR job or as part
of a select * statement.
|
static boolean |
isNullableType(org.apache.avro.Schema schema)
Determine if an Avro schema is of type Union[T, NULL].
|
public static final java.lang.String SCHEMA_LITERAL
public static final java.lang.String SCHEMA_URL
public static final java.lang.String SCHEMA_NONE
public static final java.lang.String EXCEPTION_MESSAGE
public static final java.lang.String AVRO_SERDE_SCHEMA
public static org.apache.avro.Schema determineSchemaOrThrowException(java.util.Properties properties) throws java.io.IOException, AvroSerdeException
properties
- containing a key pointing to the schema, one way or anotherjava.io.IOException
- if error while trying to read the schema from another locationAvroSerdeException
- if unable to find a schema or pointer to it in the propertiespublic static org.apache.avro.Schema determineSchemaOrReturnErrorSchema(java.util.Properties props)
protected static org.apache.avro.Schema getSchemaFromHDFS(java.lang.String schemaHDFSUrl, Configuration conf) throws java.io.IOException
java.io.IOException
public static boolean isNullableType(org.apache.avro.Schema schema)
public static org.apache.avro.Schema getOtherTypeFromNullableType(org.apache.avro.Schema schema)
public static boolean insideMRJob(JobConf job)
job
- that contains things that are or are not set in a jobCopyright © 2012 The Apache Software Foundation