Class MultiFileRowReader
java.lang.Object
dev.hardwood.reader.MultiFileRowReader
- All Implemented Interfaces:
RowReader, AutoCloseable
A RowReader that reads across multiple Parquet files with automatic file prefetching.
This reader uses a FileManager to handle file lifecycle and prefetching.
The next file is automatically prepared while reading the current file, minimizing
latency at file boundaries.
Usage:
try (Hardwood hardwood = Hardwood.create();
MultiFileParquetReader parquet = hardwood.openAll(files);
MultiFileRowReader reader = parquet.createRowReader()) {
while (reader.hasNext()) {
reader.next();
// access data using same API as RowReader
}
}
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()byte[]getBinary(int columnIndex) Get a BINARY field value by field index.byte[]Get a BINARY field value by name.booleangetBoolean(int columnIndex) Get a BOOLEAN field value by field index.booleangetBoolean(String name) Get a BOOLEAN field value by name.getDate(int columnIndex) Get a DATE field value by field index.Get a DATE field value by name.getDecimal(int columnIndex) Get a DECIMAL field value by field index.getDecimal(String name) Get a DECIMAL field value by name.doublegetDouble(int columnIndex) 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 columnIndex) Get a FLOAT field value by field index.floatGet a FLOAT field value by name.intgetInt(int columnIndex) Get an INT32 field value by field index.intGet an INT32 field value by name.getList(int columnIndex) Get a LIST field value by field index.Get a LIST field value by name.getListOfDoubles(int columnIndex) Get a DOUBLE list field by field index.getListOfDoubles(String name) Get a DOUBLE list field by name.getListOfInts(int columnIndex) Get an INT32 list field by field index.getListOfInts(String name) Get an INT32 list field by name.getListOfLongs(int columnIndex) Get an INT64 list field by field index.getListOfLongs(String name) Get an INT64 list field by name.longgetLong(int columnIndex) Get an INT64 field value by field index.longGet an INT64 field value by name.getMap(int columnIndex) Get a MAP field value by field index.Get a MAP field value by name.getString(int columnIndex) Get a STRING field value by field index.Get a STRING field value by name.getStruct(int columnIndex) Get a nested struct field value by field index.Get a nested struct field value by name.getTime(int columnIndex) Get a TIME field value by field index.Get a TIME field value by name.getTimestamp(int columnIndex) Get a TIMESTAMP field value by field index.getTimestamp(String name) Get a TIMESTAMP field value by name.getUuid(int columnIndex) Get a UUID field value by field index.Get a UUID field value by name.getValue(int columnIndex) 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.protected voidEnsures the reader is initialized.booleanisNull(int columnIndex) Check if a field is null by field index.booleanCheck if a field is null by name.protected booleanLoads the next batch of data.voidnext()Advance to the next row.
-
Field Details
-
dataView
protected dev.hardwood.internal.reader.BatchDataView dataView -
rowIndex
protected int rowIndex -
batchSize
protected int batchSize -
exhausted
protected boolean exhausted -
closed
protected volatile boolean closed -
initialized
protected boolean initialized
-
-
Method Details
-
initialize
protected void initialize()Ensures the reader is initialized. Called by metadata methods that may be invoked before iteration starts. -
loadNextBatch
protected boolean loadNextBatch()Loads the next batch of data.- Returns:
- true if a batch was loaded, false if no more data
-
close
public void close() -
hasNext
-
next
-
getInt
-
getInt
-
getLong
-
getLong
-
getFloat
-
getFloat
-
getDouble
-
getDouble
-
getBoolean
Description copied from interface:RowReaderGet a BOOLEAN field value by name.- Specified by:
getBooleanin interfaceRowReader
-
getBoolean
public boolean getBoolean(int columnIndex) Description copied from interface:RowReaderGet a BOOLEAN field value by field index.- Specified by:
getBooleanin interfaceRowReader
-
getString
-
getString
-
getBinary
-
getBinary
-
getDate
-
getDate
-
getTime
-
getTime
-
getTimestamp
Description copied from interface:RowReaderGet a TIMESTAMP field value by name.- Specified by:
getTimestampin interfaceRowReader- Returns:
- the timestamp value, or null if the field is null
-
getTimestamp
Description copied from interface:RowReaderGet a TIMESTAMP field value by field index.- Specified by:
getTimestampin interfaceRowReader- Returns:
- the timestamp value, or null if the field is null
-
getDecimal
Description copied from interface:RowReaderGet a DECIMAL field value by name.- Specified by:
getDecimalin interfaceRowReader- Returns:
- the decimal value, or null if the field is null
-
getDecimal
Description copied from interface:RowReaderGet a DECIMAL field value by field index.- Specified by:
getDecimalin interfaceRowReader- Returns:
- the decimal value, or null if the field is null
-
getUuid
-
getUuid
-
getStruct
-
getListOfInts
Description copied from interface:RowReaderGet an INT32 list field by name.- Specified by:
getListOfIntsin interfaceRowReader- Returns:
- the list, or null if the field is null
-
getListOfLongs
Description copied from interface:RowReaderGet an INT64 list field by name.- Specified by:
getListOfLongsin interfaceRowReader- Returns:
- the list, or null if the field is null
-
getListOfDoubles
Description copied from interface:RowReaderGet a DOUBLE list field by name.- Specified by:
getListOfDoublesin interfaceRowReader- Returns:
- the list, or null if the field is null
-
getList
-
getMap
-
getStruct
-
getListOfInts
Description copied from interface:RowReaderGet an INT32 list field by field index.- Specified by:
getListOfIntsin interfaceRowReader- Returns:
- the list, or null if the field is null
-
getListOfLongs
Description copied from interface:RowReaderGet an INT64 list field by field index.- Specified by:
getListOfLongsin interfaceRowReader- Returns:
- the list, or null if the field is null
-
getListOfDoubles
Description copied from interface:RowReaderGet a DOUBLE list field by field index.- Specified by:
getListOfDoublesin interfaceRowReader- Returns:
- the list, or null if the field is null
-
getList
-
getMap
-
getValue
-
getValue
-
isNull
-
isNull
-
getFieldCount
public int getFieldCount()Description copied from interface:RowReaderGet the number of fields in the current row.- Specified by:
getFieldCountin interfaceRowReader
-
getFieldName
Description copied from interface:RowReaderGet the name of a field by index.- Specified by:
getFieldNamein interfaceRowReader
-