rdblue commented on a change in pull request #618: Fix for 'Error reading Avro 
files containing array of struct with 2 fields #605'
URL: https://github.com/apache/incubator-iceberg/pull/618#discussion_r344408155
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/avro/AvroSchemaVisitor.java
 ##########
 @@ -58,7 +58,7 @@
         return visitor.union(schema, options);
 
       case ARRAY:
-        if (schema.getLogicalType() instanceof LogicalMap || 
AvroSchemaUtil.isKeyValueSchema(schema.getElementType())) {
+        if (schema.getLogicalType() instanceof LogicalMap && 
AvroSchemaUtil.isKeyValueSchema(schema.getElementType())) {
 
 Review comment:
   Yes, that sounds good.
   
   This was originally an or condition because we had manifest files that were 
written with arrays of structs for maps, but without the map logical type. We 
still want to support reading files like that (at least in our version) but I 
think the right way to support it is to use an `AvroSchemaWithType` visitor 
introduced in #601 and checking whether the Iceberg type is a map.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to