randreucetti commented on code in PR #18434:
URL: https://github.com/apache/iceberg/pull/18434#discussion_r4424489234


##########
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:
   Good catch, added a `struct field without field id` case to 
`unprojectedShreddedVariants()`, a nested variant with no id, the same shape 
`addFallbackIds` leaves behind. It fails without the fix, and I checked it's 
the only case that fails if the `getId() == null` check is removed, so that 
branch is covered now.



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

Reply via email to