Interface RowReader
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
MultiFileRowReader
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 Summary
Modifier and TypeMethodDescriptionvoidclose()byte[]getBinary(int fieldIndex) Get a BINARY field value by field index.byte[]Get a BINARY field value by name.booleangetBoolean(int fieldIndex) Get a BOOLEAN field value by field index.booleangetBoolean(String name) Get a BOOLEAN field value by name.getDate(int fieldIndex) Get a DATE field value by field index.Get a DATE field value by name.getDecimal(int fieldIndex) Get a DECIMAL field value by field index.getDecimal(String name) Get a DECIMAL field value by name.doublegetDouble(int fieldIndex) Get a DOUBLE field value by field index.doubleGet a DOUBLE field value by name.intGet the number of fields in the current row.getFieldName(int index) Get the name of a field by index.floatgetFloat(int fieldIndex) Get a FLOAT field value by field index.floatGet a FLOAT field value by name.intgetInt(int fieldIndex) Get an INT32 field value by field index.intGet an INT32 field value by name.getList(int fieldIndex) Get a LIST field value by field index.Get a LIST field value by name.getListOfDoubles(int fieldIndex) Get a DOUBLE list field by field index.getListOfDoubles(String name) Get a DOUBLE list field by name.getListOfInts(int fieldIndex) Get an INT32 list field by field index.getListOfInts(String name) Get an INT32 list field by name.getListOfLongs(int fieldIndex) Get an INT64 list field by field index.getListOfLongs(String name) Get an INT64 list field by name.longgetLong(int fieldIndex) Get an INT64 field value by field index.longGet an INT64 field value by name.getMap(int fieldIndex) Get a MAP field value by field index.Get a MAP field value by name.getString(int fieldIndex) Get a STRING field value by field index.Get a STRING field value by name.getStruct(int fieldIndex) Get a nested struct field value by field index.Get a nested struct field value by name.getTime(int fieldIndex) Get a TIME field value by field index.Get a TIME field value by name.getTimestamp(int fieldIndex) Get a TIMESTAMP field value by field index.getTimestamp(String name) Get a TIMESTAMP field value by name.getUuid(int fieldIndex) Get a UUID field value by field index.Get a UUID field value by name.getValue(int fieldIndex) Get a field value by field index without type conversion.Get a field value by name without type conversion.booleanhasNext()Check if there are more rows to read.booleanisNull(int fieldIndex) Check if a field is null by field index.booleanCheck if a field is null by name.voidnext()Advance to the next row.
-
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:
closein interfaceAutoCloseable
-
isNull
Check if a field is null by name. -
getFieldCount
int getFieldCount()Get the number of fields in the current row. -
getFieldName
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
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
Get a DATE field value by field index.- Returns:
- the date value, or null if the field is null
-
getTime
Get a TIME field value by field index.- Returns:
- the time value, or null if the field is null
-
getTimestamp
Get a TIMESTAMP field value by field index.- Returns:
- the timestamp value, or null if the field is null
-
getDecimal
Get a DECIMAL field value by field index.- Returns:
- the decimal value, or null if the field is null
-
getUuid
Get a UUID field value by field index.- Returns:
- the UUID value, or null if the field is null
-
getStruct
Get a nested struct field value by field index.- Returns:
- the struct value, or null if the field is null
-
getListOfInts
Get an INT32 list field by field index.- Returns:
- the list, or null if the field is null
-
getListOfLongs
Get an INT64 list field by field index.- Returns:
- the list, or null if the field is null
-
getListOfDoubles
Get a DOUBLE list field by field index.- Returns:
- the list, or null if the field is null
-
getList
Get a LIST field value by field index.- Returns:
- the list, or null if the field is null
-
getMap
Get a MAP field value by field index.- Returns:
- the map, or null if the field is null
-
getValue
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
Get an INT32 field value by name.- Throws:
NullPointerException- if the field is null
-
getLong
Get an INT64 field value by name.- Throws:
NullPointerException- if the field is null
-
getFloat
Get a FLOAT field value by name.- Throws:
NullPointerException- if the field is null
-
getDouble
Get a DOUBLE field value by name.- Throws:
NullPointerException- if the field is null
-
getBoolean
Get a BOOLEAN field value by name.- Throws:
NullPointerException- if the field is null
-
getString
-
getBinary
Get a BINARY field value by name.- Returns:
- the binary value, or null if the field is null
-
getDate
-
getTime
-
getTimestamp
-
getDecimal
Get a DECIMAL field value by name.- Returns:
- the decimal value, or null if the field is null
-
getUuid
-
getStruct
-
getListOfInts
-
getListOfLongs
Get an INT64 list field by name.- Returns:
- the list, or null if the field is null
-
getListOfDoubles
Get a DOUBLE list field by name.- Returns:
- the list, or null if the field is null
-
getList
-
getMap
-
getValue
-