clairemcginty commented on code in PR #1300:
URL: https://github.com/apache/parquet-mr/pull/1300#discussion_r1525297081


##########
parquet-avro/src/main/java/org/apache/parquet/avro/AvroRecordConverter.java:
##########
@@ -930,6 +930,7 @@ public void end() {
   static boolean isElementType(Type repeatedType, Schema elementSchema) {
     if (repeatedType.isPrimitive()
         || repeatedType.asGroupType().getFieldCount() > 1
+        || repeatedType.getName().equals("array")

Review Comment:
   This now matches the List [logical-type 
spec](https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#backward-compatibility-rules):
   
   > If the repeated field is a group with one field and is named either array 
or uses the LIST-annotated group's name with _tuple appended then the repeated 
type is the element type and elements are required.
   
   as well as the equivalent isElementType check in AvroSchemaConverter: 
https://github.com/apache/parquet-mr/blob/61bdf44/parquet-avro/src/main/java/org/apache/parquet/avro/AvroSchemaConverter.java#L575-L584
   
   Note: We don't have to add another clause to check for the `_tuple` style 
naming scheme, as that's already covered by line 934: 
`repeatedType.asGroupType().getType(0).isRepetition(REPEATED))`.



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