Interface RowReader
- All Superinterfaces:
AutoCloseable, FieldAccessor, StructAccessor
Provides row-oriented iteration over a Parquet file.
A RowReader is a stateful, mutable view providing access to the current row
in the iterator. The values returned by its accessors change between calls of next().
Usage example:
try (RowReader rowReader = fileReader.rowReader()) {
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()static RowReadercreate(dev.hardwood.internal.reader.RowGroupIterator rowGroupIterator, FileSchema schema, ProjectedSchema projectedSchema, dev.hardwood.internal.reader.HardwoodContextImpl context, dev.hardwood.internal.predicate.ResolvedPredicate filter, long maxRows) Creates aRowReaderfor the given pipeline components.booleanhasNext()Check if there are more rows to read.voidnext()Advance to the next row.Methods inherited from interface FieldAccessor
getBinary, getBoolean, getDate, getDecimal, getDouble, getFieldCount, getFieldName, getFloat, getInt, getInterval, getLong, getRawValue, getString, getTime, getTimestamp, getUuid, getValue, getVariant, isNullMethods inherited from interface StructAccessor
getBinary, getBoolean, getDate, getDecimal, getDouble, getFloat, getInt, getInterval, getList, getList, getLong, getMap, getMap, getRawValue, getString, getStruct, getStruct, getTime, getTimestamp, getUuid, getValue, getVariant, isNull
-
Method Details
-
create
static RowReader create(dev.hardwood.internal.reader.RowGroupIterator rowGroupIterator, FileSchema schema, ProjectedSchema projectedSchema, dev.hardwood.internal.reader.HardwoodContextImpl context, dev.hardwood.internal.predicate.ResolvedPredicate filter, long maxRows) Creates a
RowReaderfor the given pipeline components.Selects
FlatRowReaderfor flat schemas andNestedRowReaderfor nested schemas. Wraps withFilteredRowReaderwhen a filter is present.- Parameters:
rowGroupIterator- initialized iterator over row groupsschema- file schemaprojectedSchema- column projectioncontext- hardwood contextfilter- resolved predicate, ornullfor no filteringmaxRows- maximum rows (0 = unlimited)
-
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
-