diff --git a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnPageReaderImpl.java b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnPageReaderImpl.java index c57acbb4964..e85b3fe06f2 100644 --- a/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnPageReaderImpl.java +++ b/extensions/parquet/base/src/main/java/io/deephaven/parquet/base/ColumnPageReaderImpl.java @@ -54,11 +54,19 @@ public class ColumnPageReaderImpl implements ColumnPageReader { private final Path filePath; private final List fieldTypes; + /** + * Stores the offset from where the next byte should be read. Can be the offset of page header if + * {@link #pageHeader} is {@code null}, else will be the offset of data. + */ private long offset; private PageHeader pageHeader; private int numValues; private int rowCount = -1; + /** + * @param offset The offset for page header if supplied {@code pageHeader} is {@code null}. Else, the offset of data + * in the page. + */ ColumnPageReaderImpl(SeekableChannelsProvider channelsProvider, CompressorAdapter compressorAdapter, Supplier dictionarySupplier, @@ -108,6 +116,10 @@ public IntBuffer readKeyValues(IntBuffer keyDest, int nullPlaceholder) throws IO } } + /** + * If {@link #pageHeader} is {@code null}, read it from the {@link #offset} and increment the {@link #offset} by the + * length of page header. Also, read the number of values in the page from the header. + */ private synchronized void ensurePageHeader(SeekableByteChannel file) throws IOException { if (pageHeader == null) { offset = file.position();