Package org.apache.parquet.hadoop
Class ParquetReader<T>
- java.lang.Object
-
- org.apache.parquet.hadoop.ParquetReader<T>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ParquetReader<T> extends Object implements Closeable
Read records from a Parquet file. TODO: too many constructors (https://issues.apache.org/jira/browse/PARQUET-39)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ParquetReader.Builder<T>
-
Constructor Summary
Constructors Constructor Description ParquetReader(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ParquetReader.Builder<T>
builder(ReadSupport<T> readSupport, org.apache.hadoop.fs.Path path)
void
close()
long
getCurrentRowIndex()
T
read()
static <T> ParquetReader.Builder<T>
read(org.apache.parquet.io.InputFile file)
-
-
-
Constructor Detail
-
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 Detail
-
read
public T read() throws IOException
- Returns:
- the next record or null if finished
- Throws:
IOException
- if there is an error while reading
-
getCurrentRowIndex
public long getCurrentRowIndex()
- Returns:
- the row index of the last read row. If no row has been processed, returns -1.
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
read
public static <T> ParquetReader.Builder<T> read(org.apache.parquet.io.InputFile file) throws IOException
- Throws:
IOException
-
builder
public static <T> ParquetReader.Builder<T> builder(ReadSupport<T> readSupport, org.apache.hadoop.fs.Path path)
-
-