rdblue commented on code in PR #12836: URL: https://github.com/apache/iceberg/pull/12836#discussion_r2051001564
########## parquet/src/main/java/org/apache/iceberg/parquet/ParquetValueReaders.java: ########## @@ -322,6 +333,88 @@ public void setPageSource(PageReadStore pageStore) { } } + private static class RowIdReader implements ParquetValueReader<Long> { + private final long firstRowId; + private final ParquetValueReader<Long> idReader; + private long rowOffset = -1; + private long rowGroupStart; + + private RowIdReader(long firstRowId, ParquetValueReader<Long> idReader) { + this.firstRowId = firstRowId; + this.idReader = idReader != null ? idReader : nulls(); + } + + @Override + public Long read(Long reuse) { + rowOffset += 1; + + Long idFromFile = idReader.read(null); + if (idFromFile != null) { + return idFromFile; + } + + return firstRowId + rowGroupStart + rowOffset; Review Comment: You're right, I think that's cleaner. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org