Interface RowReader

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
MultiFileRowReader

public interface RowReader extends AutoCloseable
Provides row-oriented iteration over a Parquet file.

Usage example:

try (RowReader rowReader = fileReader.createRowReader()) {
    while (rowReader.hasNext()) {
        rowReader.next();
        long id = rowReader.getLong("id");
        PqStruct address = rowReader.getStruct("address");
        String city = address.getString("city");
    }
}
  • Method Details

    • hasNext

      boolean hasNext()
      Check if there are more rows to read.
      Returns:
      true if there are more rows available
    • next

      void next()
      Advance to the next row. Must be called before accessing row data.
      Throws:
      NoSuchElementException - if no more rows are available
    • close

      void close()
      Specified by:
      close in interface AutoCloseable
    • isNull

      boolean isNull(String name)
      Check if a field is null by name.
    • getFieldCount

      int getFieldCount()
      Get the number of fields in the current row.
    • getFieldName

      String getFieldName(int index)
      Get the name of a field by index.
    • getInt

      int getInt(int fieldIndex)
      Get an INT32 field value by field index.
      Throws:
      NullPointerException - if the field is null
    • getLong

      long getLong(int fieldIndex)
      Get an INT64 field value by field index.
      Throws:
      NullPointerException - if the field is null
    • getFloat

      float getFloat(int fieldIndex)
      Get a FLOAT field value by field index.
      Throws:
      NullPointerException - if the field is null
    • getDouble

      double getDouble(int fieldIndex)
      Get a DOUBLE field value by field index.
      Throws:
      NullPointerException - if the field is null
    • getBoolean

      boolean getBoolean(int fieldIndex)
      Get a BOOLEAN field value by field index.
      Throws:
      NullPointerException - if the field is null
    • getString

      String getString(int fieldIndex)
      Get a STRING field value by field index.
      Returns:
      the string value, or null if the field is null
    • getBinary

      byte[] getBinary(int fieldIndex)
      Get a BINARY field value by field index.
      Returns:
      the binary value, or null if the field is null
    • getDate

      LocalDate getDate(int fieldIndex)
      Get a DATE field value by field index.
      Returns:
      the date value, or null if the field is null
    • getTime

      LocalTime getTime(int fieldIndex)
      Get a TIME field value by field index.
      Returns:
      the time value, or null if the field is null
    • getTimestamp

      Instant getTimestamp(int fieldIndex)
      Get a TIMESTAMP field value by field index.
      Returns:
      the timestamp value, or null if the field is null
    • getDecimal

      BigDecimal getDecimal(int fieldIndex)
      Get a DECIMAL field value by field index.
      Returns:
      the decimal value, or null if the field is null
    • getUuid

      UUID getUuid(int fieldIndex)
      Get a UUID field value by field index.
      Returns:
      the UUID value, or null if the field is null
    • getStruct

      PqStruct getStruct(int fieldIndex)
      Get a nested struct field value by field index.
      Returns:
      the struct value, or null if the field is null
    • getListOfInts

      PqIntList getListOfInts(int fieldIndex)
      Get an INT32 list field by field index.
      Returns:
      the list, or null if the field is null
    • getListOfLongs

      PqLongList getListOfLongs(int fieldIndex)
      Get an INT64 list field by field index.
      Returns:
      the list, or null if the field is null
    • getListOfDoubles

      PqDoubleList getListOfDoubles(int fieldIndex)
      Get a DOUBLE list field by field index.
      Returns:
      the list, or null if the field is null
    • getList

      PqList getList(int fieldIndex)
      Get a LIST field value by field index.
      Returns:
      the list, or null if the field is null
    • getMap

      PqMap getMap(int fieldIndex)
      Get a MAP field value by field index.
      Returns:
      the map, or null if the field is null
    • getValue

      Object getValue(int fieldIndex)
      Get a field value by field index without type conversion.
      Returns:
      the raw value, or null if the field is null
    • isNull

      boolean isNull(int fieldIndex)
      Check if a field is null by field index.
    • getInt

      int getInt(String name)
      Get an INT32 field value by name.
      Throws:
      NullPointerException - if the field is null
    • getLong

      long getLong(String name)
      Get an INT64 field value by name.
      Throws:
      NullPointerException - if the field is null
    • getFloat

      float getFloat(String name)
      Get a FLOAT field value by name.
      Throws:
      NullPointerException - if the field is null
    • getDouble

      double getDouble(String name)
      Get a DOUBLE field value by name.
      Throws:
      NullPointerException - if the field is null
    • getBoolean

      boolean getBoolean(String name)
      Get a BOOLEAN field value by name.
      Throws:
      NullPointerException - if the field is null
    • getString

      String getString(String name)
      Get a STRING field value by name.
      Returns:
      the string value, or null if the field is null
    • getBinary

      byte[] getBinary(String name)
      Get a BINARY field value by name.
      Returns:
      the binary value, or null if the field is null
    • getDate

      LocalDate getDate(String name)
      Get a DATE field value by name.
      Returns:
      the date value, or null if the field is null
    • getTime

      LocalTime getTime(String name)
      Get a TIME field value by name.
      Returns:
      the time value, or null if the field is null
    • getTimestamp

      Instant getTimestamp(String name)
      Get a TIMESTAMP field value by name.
      Returns:
      the timestamp value, or null if the field is null
    • getDecimal

      BigDecimal getDecimal(String name)
      Get a DECIMAL field value by name.
      Returns:
      the decimal value, or null if the field is null
    • getUuid

      UUID getUuid(String name)
      Get a UUID field value by name.
      Returns:
      the UUID value, or null if the field is null
    • getStruct

      PqStruct getStruct(String name)
      Get a nested struct field value by name.
      Returns:
      the struct value, or null if the field is null
    • getListOfInts

      PqIntList getListOfInts(String name)
      Get an INT32 list field by name.
      Returns:
      the list, or null if the field is null
    • getListOfLongs

      PqLongList getListOfLongs(String name)
      Get an INT64 list field by name.
      Returns:
      the list, or null if the field is null
    • getListOfDoubles

      PqDoubleList getListOfDoubles(String name)
      Get a DOUBLE list field by name.
      Returns:
      the list, or null if the field is null
    • getList

      PqList getList(String name)
      Get a LIST field value by name.
      Returns:
      the list, or null if the field is null
    • getMap

      PqMap getMap(String name)
      Get a MAP field value by name.
      Returns:
      the map, or null if the field is null
    • getValue

      Object getValue(String name)
      Get a field value by name without type conversion.
      Returns:
      the raw value, or null if the field is null