public class AvroReadSupport<T extends org.apache.avro.generic.IndexedRecord> extends ReadSupport<T>
ReadSupport
for Avro IndexedRecord
s which cover both Avro Specific and
Generic. Users should use AvroParquetReader
or AvroParquetInputFormat
rather than using
this class directly.ReadSupport.ReadContext
Modifier and Type | Field and Description |
---|---|
static String |
AVRO_REQUESTED_PROJECTION |
PARQUET_READ_SCHEMA
Constructor and Description |
---|
AvroReadSupport() |
Modifier and Type | Method and Description |
---|---|
ReadSupport.ReadContext |
init(org.apache.hadoop.conf.Configuration configuration,
Map<String,String> keyValueMetaData,
MessageType fileSchema)
called in
InputFormat.getSplits(org.apache.hadoop.mapreduce.JobContext) in the front end |
RecordMaterializer<T> |
prepareForRead(org.apache.hadoop.conf.Configuration configuration,
Map<String,String> keyValueMetaData,
MessageType fileSchema,
ReadSupport.ReadContext readContext)
called in
RecordReader.initialize(org.apache.hadoop.mapreduce.InputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext) in the back end
the returned RecordConsumer will materialize the records and add them to the destination |
static void |
setAvroReadSchema(org.apache.hadoop.conf.Configuration configuration,
org.apache.avro.Schema avroReadSchema) |
static void |
setRequestedProjection(org.apache.hadoop.conf.Configuration configuration,
org.apache.avro.Schema requestedProjection) |
getSchemaForRead, getSchemaForRead, init
public static String AVRO_REQUESTED_PROJECTION
public static void setRequestedProjection(org.apache.hadoop.conf.Configuration configuration, org.apache.avro.Schema requestedProjection)
public static void setAvroReadSchema(org.apache.hadoop.conf.Configuration configuration, org.apache.avro.Schema avroReadSchema)
public ReadSupport.ReadContext init(org.apache.hadoop.conf.Configuration configuration, Map<String,String> keyValueMetaData, MessageType fileSchema)
ReadSupport
InputFormat.getSplits(org.apache.hadoop.mapreduce.JobContext)
in the front endinit
in class ReadSupport<T extends org.apache.avro.generic.IndexedRecord>
configuration
- the job configurationkeyValueMetaData
- the app specific metadata from the filefileSchema
- the schema of the filepublic RecordMaterializer<T> prepareForRead(org.apache.hadoop.conf.Configuration configuration, Map<String,String> keyValueMetaData, MessageType fileSchema, ReadSupport.ReadContext readContext)
ReadSupport
RecordReader.initialize(org.apache.hadoop.mapreduce.InputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext)
in the back end
the returned RecordConsumer will materialize the records and add them to the destinationprepareForRead
in class ReadSupport<T extends org.apache.avro.generic.IndexedRecord>
configuration
- the job configurationkeyValueMetaData
- the app specific metadata from the filefileSchema
- the schema of the filereadContext
- returned by the init methodCopyright © 2015. All rights reserved.