nssalian commented on code in PR #18851:
URL: https://github.com/apache/iceberg/pull/18851#discussion_r4556355289


##########
arrow/src/test/java/org/apache/iceberg/arrow/vectorized/TestVectorizedReaderBuilder.java:
##########
@@ -171,14 +174,47 @@ void projectingShreddedVariantUnsupported() {
             .addField(shreddedVariant(Type.Repetition.OPTIONAL, 2, "data"))
             .named("table");
 
+    VectorizedReaderBuilder builder =
+        new VectorizedReaderBuilder(
+            icebergSchema, parquetSchema, false, ImmutableMap.of(), readers -> 
readers.get(1));
+
+    VectorizedReader<?> reader =
+        TypeWithSchemaVisitor.visit(icebergSchema.asStruct(), parquetSchema, 
builder);
+
+    
assertThat(reader).isInstanceOf(VectorizedArrowReader.RowBasedVariantReader.class);
+  }
+
+  @Test
+  void projectedShreddedListElementWithoutFieldIdSkipped() {
+    Schema icebergSchema =
+        new Schema(
+            NestedField.required(1, "id", IntegerType.get()),
+            NestedField.optional(2, "list", ListType.ofOptional(3, 
VariantType.get())));
+
+    MessageType parquetSchema =
+        Types.buildMessage()
+            .addField(
+                Types.primitive(PrimitiveTypeName.INT32, 
Type.Repetition.REQUIRED)
+                    .id(1)
+                    .named("id"))
+            .addField(
+                Types.buildGroup(Type.Repetition.OPTIONAL)
+                    .as(LogicalTypeAnnotation.listType())
+                    .addField(
+                        Types.buildGroup(Type.Repetition.REPEATED)
+                            
.addField(shreddedVariant(Type.Repetition.OPTIONAL, "element"))

Review Comment:
   Renamed it to projectedShreddedListElementSkipped: the list element now has 
a field id, and the test asserts variant() returns no reader for it. It now 
fails on main and fails without the repetition-level check.



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