Package org.apache.parquet.hadoop
Class ParquetReader<T>
java.lang.Object
org.apache.parquet.hadoop.ParquetReader<T>
- All Implemented Interfaces:
Closeable,AutoCloseable
Read records from a Parquet file.
TODO: too many constructors (https://github.com/apache/parquet-java/issues/1466)
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionParquetReader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path file, ReadSupport<T> readSupport) Deprecated.ParquetReader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path file, ReadSupport<T> readSupport, org.apache.parquet.filter.UnboundRecordFilter unboundRecordFilter) Deprecated.ParquetReader(org.apache.hadoop.fs.Path file, ReadSupport<T> readSupport) Deprecated.ParquetReader(org.apache.hadoop.fs.Path file, ReadSupport<T> readSupport, org.apache.parquet.filter.UnboundRecordFilter unboundRecordFilter) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ParquetReader.Builder<T>builder()static <T> ParquetReader.Builder<T>builder(ReadSupport<T> readSupport, org.apache.hadoop.fs.Path path) voidclose()intlongread()static <T> ParquetReader.Builder<T>read(org.apache.parquet.io.InputFile file) static <T> ParquetReader.Builder<T>read(org.apache.parquet.io.InputFile file, org.apache.parquet.conf.ParquetConfiguration conf)
-
Constructor Details
-
ParquetReader
@Deprecated public ParquetReader(org.apache.hadoop.fs.Path file, ReadSupport<T> readSupport) throws IOException Deprecated.- Parameters:
file- the file to readreadSupport- to materialize records- Throws:
IOException- if there is an error while reading
-
ParquetReader
@Deprecated public ParquetReader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path file, ReadSupport<T> readSupport) throws IOException Deprecated.- Parameters:
conf- the configurationfile- the file to readreadSupport- to materialize records- Throws:
IOException- if there is an error while reading
-
ParquetReader
@Deprecated public ParquetReader(org.apache.hadoop.fs.Path file, ReadSupport<T> readSupport, org.apache.parquet.filter.UnboundRecordFilter unboundRecordFilter) throws IOException Deprecated.- Parameters:
file- the file to readreadSupport- to materialize recordsunboundRecordFilter- the filter to use to filter records- Throws:
IOException- if there is an error while reading
-
ParquetReader
@Deprecated public ParquetReader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path file, ReadSupport<T> readSupport, org.apache.parquet.filter.UnboundRecordFilter unboundRecordFilter) throws IOException Deprecated.- Parameters:
conf- the configurationfile- the file to readreadSupport- to materialize recordsunboundRecordFilter- the filter to use to filter records- Throws:
IOException- if there is an error while reading
-
-
Method Details
-
read
- Returns:
- the next record or null if finished
- Throws:
IOException- if there is an error while reading
-
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
public long getCurrentRowIndex()- Returns:
- the row index of the last read row. If no row has been processed, returns -1.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
read
public static <T> ParquetReader.Builder<T> read(org.apache.parquet.io.InputFile file) throws IOException - Throws:
IOException
-
read
public static <T> ParquetReader.Builder<T> read(org.apache.parquet.io.InputFile file, org.apache.parquet.conf.ParquetConfiguration conf) throws IOException - Throws:
IOException
-
builder
public static <T> ParquetReader.Builder<T> builder(ReadSupport<T> readSupport, org.apache.hadoop.fs.Path path) -
builder
-
builder(ReadSupport, Path)