public class AvroSerdeUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AvroSerdeUtils.AvroTableProperties
Enum container for all avro table properties.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AVRO_SERDE_SCHEMA
Deprecated.
|
static java.lang.String |
EXCEPTION_MESSAGE |
static java.lang.String |
SCHEMA_DOC
Deprecated.
|
static java.lang.String |
SCHEMA_LITERAL
Deprecated.
|
static java.lang.String |
SCHEMA_NAME
Deprecated.
|
static java.lang.String |
SCHEMA_NAMESPACE
Deprecated.
|
static java.lang.String |
SCHEMA_NONE |
static java.lang.String |
SCHEMA_RETRIEVER
Deprecated.
|
static java.lang.String |
SCHEMA_URL
Deprecated.
|
| Constructor and Description |
|---|
AvroSerdeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.avro.Schema |
determineSchemaOrThrowException(org.apache.hadoop.conf.Configuration conf,
java.util.Properties properties)
Determine the schema to that's been provided for Avro serde work.
|
static java.nio.Buffer |
getBufferFromBytes(byte[] input) |
static java.nio.Buffer |
getBufferFromDecimal(org.apache.hadoop.hive.common.type.HiveDecimal dec,
int scale) |
static byte[] |
getBytesFromByteBuffer(java.nio.ByteBuffer byteBuffer) |
static org.apache.hadoop.hive.common.type.HiveDecimal |
getHiveDecimalFromByteBuffer(java.nio.ByteBuffer byteBuffer,
int scale) |
static org.apache.avro.Schema |
getOtherTypeFromNullableType(org.apache.avro.Schema unionSchema)
If the union schema is a nullable union, get the schema for the non-nullable type.
|
static org.apache.avro.Schema |
getSchemaFor(java.io.File file) |
static org.apache.avro.Schema |
getSchemaFor(java.io.InputStream stream) |
static org.apache.avro.Schema |
getSchemaFor(java.lang.String str) |
static org.apache.avro.Schema |
getSchemaFor(java.net.URL url) |
protected static org.apache.avro.Schema |
getSchemaFromFS(java.lang.String schemaFSUrl,
org.apache.hadoop.conf.Configuration conf) |
static void |
handleAlterTableForAvro(org.apache.hadoop.hive.conf.HiveConf conf,
java.lang.String serializationLib,
java.util.Map<java.lang.String,java.lang.String> parameters)
Called on specific alter table events, removes schema url and schema literal from given tblproperties
After the change, HMS solely will be responsible for handling the schema
|
static boolean |
insideMRJob(org.apache.hadoop.mapred.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].
|
@Deprecated public static final java.lang.String SCHEMA_LITERAL
@Deprecated public static final java.lang.String SCHEMA_URL
@Deprecated public static final java.lang.String SCHEMA_NAMESPACE
@Deprecated public static final java.lang.String SCHEMA_NAME
@Deprecated public static final java.lang.String SCHEMA_DOC
@Deprecated public static final java.lang.String AVRO_SERDE_SCHEMA
@Deprecated public static final java.lang.String SCHEMA_RETRIEVER
public static final java.lang.String SCHEMA_NONE
public static final java.lang.String EXCEPTION_MESSAGE
public static org.apache.avro.Schema determineSchemaOrThrowException(org.apache.hadoop.conf.Configuration conf,
java.util.Properties properties)
throws java.io.IOException,
org.apache.hadoop.hive.serde2.avro.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 propertiesprotected static org.apache.avro.Schema getSchemaFromFS(java.lang.String schemaFSUrl,
org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException,
java.net.URISyntaxException
java.io.IOExceptionjava.net.URISyntaxExceptionpublic static boolean isNullableType(org.apache.avro.Schema schema)
public static org.apache.avro.Schema getOtherTypeFromNullableType(org.apache.avro.Schema unionSchema)
public static boolean insideMRJob(org.apache.hadoop.mapred.JobConf job)
job - that contains things that are or are not set in a jobpublic static java.nio.Buffer getBufferFromBytes(byte[] input)
public static java.nio.Buffer getBufferFromDecimal(org.apache.hadoop.hive.common.type.HiveDecimal dec,
int scale)
public static byte[] getBytesFromByteBuffer(java.nio.ByteBuffer byteBuffer)
public static org.apache.hadoop.hive.common.type.HiveDecimal getHiveDecimalFromByteBuffer(java.nio.ByteBuffer byteBuffer,
int scale)
public static org.apache.avro.Schema getSchemaFor(java.lang.String str)
public static org.apache.avro.Schema getSchemaFor(java.io.File file)
public static org.apache.avro.Schema getSchemaFor(java.io.InputStream stream)
public static org.apache.avro.Schema getSchemaFor(java.net.URL url)
public static void handleAlterTableForAvro(org.apache.hadoop.hive.conf.HiveConf conf,
java.lang.String serializationLib,
java.util.Map<java.lang.String,java.lang.String> parameters)
conf - serializationLib - parameters - Copyright © 2013-2022. All Rights Reserved.