wgtmac commented on PR #43995:
URL: https://github.com/apache/arrow/pull/43995#issuecomment-2336585735

   ```
     optional group a (LIST) {
       repeated group array (LIST) {
         repeated int32 array;
       }
     }
   ```
   IMO, the root cause is that the current code recognizes the schema above as 
a three-level encoding. However, the inner-most field can only be `required` or 
`optional` in three-level encoding, but here the int32 field is `repeated`. We 
can decouple the nesting field into two lists as below:
   ```
     outer_list:
     optional group a (LIST) {
       repeated group array (LIST) {}
     }
   
     inner_list:
     repeated group array (LIST) {
       repeated int32 array;
     }
   ```
   
   It is obvious that `inner_list` can simply apply backward-compatibility rule 
(1). For the `outer_list`, the current code applies rule (3). I think we need 
to apply rule (4) here by modifying the rule (3) to below:
   
   > If the repeated field is a group with one **required or optional** 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.
   
   
   
   


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

Reply via email to