nssalian commented on code in PR #18434:
URL: https://github.com/apache/iceberg/pull/18434#discussion_r4362316720
##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorizedReaderBuilder.java:
##########
@@ -157,6 +157,12 @@ public VectorizedReader<?> struct(
@Override
public ParquetVariantVisitor<VectorizedReader<?>> variantVisitor() {
+ // skip variants that are not projected, like primitives, so their
shredded layout is not read
+ Type variant = parquetSchema.getType(currentPath());
+ if (variant.getId() == null ||
icebergSchema.findField(variant.getId().intValue()) == null) {
Review Comment:
Could you add a test case where the variant has no field id? Every case in
`unprojectedShreddedVariants()` sets one, so this `getId() == null` check isn't
covered. The case where it can happen for a variant inside a struct when the
file has no field ids, because `addFallbackIds` only assigns ids to top-level
fields.
--
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]