rdblue commented on a change in pull request #1321:
URL: https://github.com/apache/iceberg/pull/1321#discussion_r470837948



##########
File path: 
core/src/test/java/org/apache/iceberg/avro/TestAvroReadProjection.java
##########
@@ -49,4 +56,27 @@
 
     return Iterables.getOnlyElement(records);
   }
+
+  @Test
+  public void testAvroArrayAsLogicalMap() throws IOException {
+    Schema writeSchema = new Schema(
+        Types.NestedField.optional(0, "map", Types.MapType.ofOptional(2, 3,
+            Types.LongType.get(),
+            Types.ListType.ofRequired(1, Types.LongType.get())
+        ))
+    );
+
+    List<Long> values1 = ImmutableList.of(101L, 102L);
+    List<Long> values2 = ImmutableList.of(201L, 202L, 203L);
+    GenericData.Record record = new 
GenericData.Record(AvroSchemaUtil.convert(writeSchema, "table"));
+    record.put("map", ImmutableMap.of(100L, values1, 200L, values2));
+
+    GenericData.Record projected = writeAndRead("full_projection", 
writeSchema, writeSchema, record);
+    Assert.assertEquals("Should contain correct value list",
+            values1,

Review comment:
       Thanks! I'll commit this when tests pass.




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

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