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


##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetValueReaders.java:
##########
@@ -174,6 +194,27 @@ public static ParquetValueReader<Record> recordReader(
     return new RecordReader(readers, struct);
   }
 
+  public static ParquetValueReader<?> replaceWithMetadataReader(
+      int id, ParquetValueReader<?> reader, Map<Integer, ?> idToConstant, int 
constantDL) {
+    if (id == MetadataColumns.ROW_ID.fieldId()) {
+      Long baseRowId = (Long) idToConstant.get(id);
+      return ParquetValueReaders.rowIds(baseRowId, reader);
+    } else if (id == MetadataColumns.LAST_UPDATED_SEQUENCE_NUMBER.fieldId()) {
+      Long baseRowId = (Long) idToConstant.get(id);
+      Long fileSeqNumber = (Long) idToConstant.get(id);
+      return ParquetValueReaders.lastUpdated(baseRowId, fileSeqNumber, reader);

Review Comment:
   Does the last updated reader need to care about the baseRowId? 



##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetValueReaders.java:
##########
@@ -174,6 +194,27 @@ public static ParquetValueReader<Record> recordReader(
     return new RecordReader(readers, struct);
   }
 
+  public static ParquetValueReader<?> replaceWithMetadataReader(
+      int id, ParquetValueReader<?> reader, Map<Integer, ?> idToConstant, int 
constantDL) {
+    if (id == MetadataColumns.ROW_ID.fieldId()) {
+      Long baseRowId = (Long) idToConstant.get(id);
+      return ParquetValueReaders.rowIds(baseRowId, reader);
+    } else if (id == MetadataColumns.LAST_UPDATED_SEQUENCE_NUMBER.fieldId()) {
+      Long baseRowId = (Long) idToConstant.get(id);
+      Long fileSeqNumber = (Long) idToConstant.get(id);
+      return ParquetValueReaders.lastUpdated(baseRowId, fileSeqNumber, reader);

Review Comment:
   Nvm saw your 
[comment](https://github.com/apache/iceberg/pull/12836/files#r2051043116) 
below, that rationale makes sense to me



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