amogh-jahagirdar commented on code in PR #12836:
URL: https://github.com/apache/iceberg/pull/12836#discussion_r2050851734


##########
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:
   Did we look at plumbing through the existing position reader? That way I 
think we don't have to keep track of the rowGroupStart, rowOffset ourselves. 
Though this is clean enough, so I think it's fine! 
   



-- 
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

Reply via email to