Package org.apache.parquet.hadoop.api
Class ReadSupport<T>
java.lang.Object
org.apache.parquet.hadoop.api.ReadSupport<T>
- Type Parameters:
T- the type of the materialized record
- Direct Known Subclasses:
DelegatingReadSupport,GroupReadSupport
Abstraction used by the
ParquetInputFormat to materialize records-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classinformation to read the file -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringconfiguration key for a parquet read projection schema -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.parquet.schema.MessageTypegetSchemaForRead(org.apache.parquet.schema.MessageType fileMessageType, String partialReadSchemaString) attempts to validate and construct aMessageTypefrom a read projection schemastatic org.apache.parquet.schema.MessageTypegetSchemaForRead(org.apache.parquet.schema.MessageType fileMessageType, org.apache.parquet.schema.MessageType projectedMessageType) init(org.apache.hadoop.conf.Configuration configuration, Map<String, String> keyValueMetaData, org.apache.parquet.schema.MessageType fileSchema) Deprecated.init(org.apache.parquet.conf.ParquetConfiguration configuration, Map<String, String> keyValueMetaData, org.apache.parquet.schema.MessageType fileSchema) Deprecated.overrideinit(InitContext)insteadinit(InitContext context) called inInputFormat.getSplits(org.apache.hadoop.mapreduce.JobContext)in the front endabstract org.apache.parquet.io.api.RecordMaterializer<T>prepareForRead(org.apache.hadoop.conf.Configuration configuration, Map<String, String> keyValueMetaData, org.apache.parquet.schema.MessageType fileSchema, ReadSupport.ReadContext readContext) Deprecated.overrideprepareForRead(ParquetConfiguration,Map,MessageType,ReadContext)insteadorg.apache.parquet.io.api.RecordMaterializer<T>prepareForRead(org.apache.parquet.conf.ParquetConfiguration configuration, Map<String, String> keyValueMetaData, org.apache.parquet.schema.MessageType fileSchema, ReadSupport.ReadContext readContext) called inRecordReader.initialize(org.apache.hadoop.mapreduce.InputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext)in the back end the returned RecordMaterializer will materialize the records and add them to the destination
-
Field Details
-
PARQUET_READ_SCHEMA
configuration key for a parquet read projection schema- See Also:
-
-
Constructor Details
-
ReadSupport
public ReadSupport()
-
-
Method Details
-
getSchemaForRead
public static org.apache.parquet.schema.MessageType getSchemaForRead(org.apache.parquet.schema.MessageType fileMessageType, String partialReadSchemaString) attempts to validate and construct aMessageTypefrom a read projection schema- Parameters:
fileMessageType- the typed schema of the sourcepartialReadSchemaString- the requested projection schema- Returns:
- the typed schema that should be used to read
-
getSchemaForRead
public static org.apache.parquet.schema.MessageType getSchemaForRead(org.apache.parquet.schema.MessageType fileMessageType, org.apache.parquet.schema.MessageType projectedMessageType) -
init
@Deprecated public ReadSupport.ReadContext init(org.apache.hadoop.conf.Configuration configuration, Map<String, String> keyValueMetaData, org.apache.parquet.schema.MessageType fileSchema) Deprecated.overrideinit(InitContext)insteadcalled inInputFormat.getSplits(org.apache.hadoop.mapreduce.JobContext)in the front end- Parameters:
configuration- the job configurationkeyValueMetaData- the app specific metadata from the filefileSchema- the schema of the file- Returns:
- the readContext that defines how to read the file
-
init
@Deprecated public ReadSupport.ReadContext init(org.apache.parquet.conf.ParquetConfiguration configuration, Map<String, String> keyValueMetaData, org.apache.parquet.schema.MessageType fileSchema) Deprecated.overrideinit(InitContext)insteadcalled inInputFormat.getSplits(org.apache.hadoop.mapreduce.JobContext)in the front end- Parameters:
configuration- the configurationkeyValueMetaData- the app specific metadata from the filefileSchema- the schema of the file- Returns:
- the readContext that defines how to read the file
-
init
called inInputFormat.getSplits(org.apache.hadoop.mapreduce.JobContext)in the front end- Parameters:
context- the initialisation context- Returns:
- the readContext that defines how to read the file
-
prepareForRead
@Deprecated public abstract org.apache.parquet.io.api.RecordMaterializer<T> prepareForRead(org.apache.hadoop.conf.Configuration configuration, Map<String, String> keyValueMetaData, org.apache.parquet.schema.MessageType fileSchema, ReadSupport.ReadContext readContext) Deprecated.overrideprepareForRead(ParquetConfiguration,Map,MessageType,ReadContext)insteadcalled inRecordReader.initialize(org.apache.hadoop.mapreduce.InputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext)in the back end the returned RecordMaterializer will materialize the records and add them to the destination- Parameters:
configuration- the job configurationkeyValueMetaData- the app specific metadata from the filefileSchema- the schema of the filereadContext- returned by the init method- Returns:
- the recordMaterializer that will materialize the records
-
prepareForRead
public org.apache.parquet.io.api.RecordMaterializer<T> prepareForRead(org.apache.parquet.conf.ParquetConfiguration configuration, Map<String, String> keyValueMetaData, org.apache.parquet.schema.MessageType fileSchema, ReadSupport.ReadContext readContext) called inRecordReader.initialize(org.apache.hadoop.mapreduce.InputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext)in the back end the returned RecordMaterializer will materialize the records and add them to the destination- Parameters:
configuration- the configurationkeyValueMetaData- the app specific metadata from the filefileSchema- the schema of the filereadContext- returned by the init method- Returns:
- the recordMaterializer that will materialize the records
-
init(InitContext)instead