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://github.com/apache/parquet-java/issues/1466)
  • Constructor Details

    • ParquetReader

      @Deprecated public ParquetReader(org.apache.hadoop.fs.Path file, ReadSupport<T> readSupport) throws IOException
      Parameters:
      file - the file to read
      readSupport - 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
      Parameters:
      conf - the configuration
      file - the file to read
      readSupport - 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
      Parameters:
      file - the file to read
      readSupport - to materialize records
      unboundRecordFilter - 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
      Parameters:
      conf - the configuration
      file - the file to read
      readSupport - to materialize records
      unboundRecordFilter - the filter to use to filter records
      Throws:
      IOException - if there is an error while reading
  • Method Details

    • read

      public T read() throws IOException
      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

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      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

      public static <T> ParquetReader.Builder<T> builder()