Package org.apache.parquet.hadoop
Class ParquetRecordReader<T>
java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<Void,T>
org.apache.parquet.hadoop.ParquetRecordReader<T>
- Type Parameters:
T- type of the materialized records
- All Implemented Interfaces:
Closeable,AutoCloseable
Reads the records from a block of a Parquet file
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionParquetRecordReader(ReadSupport<T> readSupport) ParquetRecordReader(ReadSupport<T> readSupport, org.apache.parquet.filter.UnboundRecordFilter filter) Deprecated.will be removed in 2.0.0.ParquetRecordReader(ReadSupport<T> readSupport, org.apache.parquet.filter2.compat.FilterCompat.Filter filter) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()always returns nullintlongfloatvoidinitialize(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.mapred.Reporter reporter) voidinitialize(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context) boolean
-
Constructor Details
-
ParquetRecordReader
- Parameters:
readSupport- Object which helps reads files of the given type, e.g. Thrift, Avro.
-
ParquetRecordReader
public ParquetRecordReader(ReadSupport<T> readSupport, org.apache.parquet.filter2.compat.FilterCompat.Filter filter) - Parameters:
readSupport- Object which helps reads files of the given type, e.g. Thrift, Avro.filter- for filtering individual records
-
ParquetRecordReader
@Deprecated public ParquetRecordReader(ReadSupport<T> readSupport, org.apache.parquet.filter.UnboundRecordFilter filter) Deprecated.will be removed in 2.0.0.- Parameters:
readSupport- Object which helps reads files of the given type, e.g. Thrift, Avro.filter- for filtering individual records
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.apache.hadoop.mapreduce.RecordReader<Void,T> - Throws:
IOException
-
getCurrentKey
always returns null- Specified by:
getCurrentKeyin classorg.apache.hadoop.mapreduce.RecordReader<Void,T> - Throws:
IOExceptionInterruptedException
-
getCurrentValue
- Specified by:
getCurrentValuein classorg.apache.hadoop.mapreduce.RecordReader<Void,T> - Throws:
IOExceptionInterruptedException
-
getProgress
- Specified by:
getProgressin classorg.apache.hadoop.mapreduce.RecordReader<Void,T> - Throws:
IOExceptionInterruptedException
-
initialize
public void initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedException - Specified by:
initializein classorg.apache.hadoop.mapreduce.RecordReader<Void,T> - Throws:
IOExceptionInterruptedException
-
initialize
public void initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.mapred.Reporter reporter) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
nextKeyValue
- Specified by:
nextKeyValuein classorg.apache.hadoop.mapreduce.RecordReader<Void,T> - Throws:
IOExceptionInterruptedException
-
getCurrentRowGroupIndex
public int getCurrentRowGroupIndex()- Returns:
- the 0-based index of the row group currently being read. If no row group has been read yet, returns -1.
-
getCurrentRowIndex
- Returns:
- the row index of the current row. If no row has been processed, returns -1.
- Throws:
IOException
-