Guosmilesmile commented on code in PR #15776:
URL: https://github.com/apache/iceberg/pull/15776#discussion_r3001479977
##########
orc/src/main/java/org/apache/iceberg/orc/OrcValueReaders.java:
##########
@@ -163,6 +168,51 @@ protected StructReader(
}
}
+ private int handleRowIdField(
+ int pos,
+ Types.NestedField field,
+ List<OrcValueReader<?>> readerList,
+ int readerIndex,
+ Map<Integer, ?> idToConstant) {
+ Long firstRowId = (Long) idToConstant.get(field.fieldId());
+ if (firstRowId != null) {
+ OrcValueReader<Long> fileIdReader =
+ readerIndex < readerList.size()
+ ? (OrcValueReader<Long>) readerList.get(readerIndex)
+ : null;
Review Comment:
I understand that `readerList` represents physical columns, while
`ROW_ID`/`LAST_UPDATED_SEQUENCE_NUMBER` may only exist in the logical
projection. Although in my testing the counts are consistent, I cannot
guarantee that there are no other scenarios where the projection and physical
fields are inconsistent. So I added `fileIdReader == null` to fall back to the
fallback path, which has a bit of a defensive programming flavor.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]