etseidl commented on code in PR #466: URL: https://github.com/apache/parquet-format/pull/466#discussion_r1826156685
########## LogicalTypes.md: ########## @@ -648,49 +648,66 @@ optional group my_list (LIST) { } ``` -Some existing data does not include the inner element layer. For -backward-compatibility, the type of elements in `LIST`-annotated structures -should always be determined by the following rules: +Some existing data does not include the inner element layer, meaning that +`LIST` annotates a 2-level structure. In contrast to 3-level structure, The +repetition of the outer level `LIST`-annotated 2-level structure can be +`optional`, `required`, or `required`. For backward-compatibility, the type of Review Comment: Is this one too many `required`? Or do you mean to add `repeated` as well? ########## LogicalTypes.md: ########## @@ -648,49 +648,66 @@ optional group my_list (LIST) { } ``` -Some existing data does not include the inner element layer. For -backward-compatibility, the type of elements in `LIST`-annotated structures -should always be determined by the following rules: +Some existing data does not include the inner element layer, meaning that +`LIST` annotates a 2-level structure. In contrast to 3-level structure, The +repetition of the outer level `LIST`-annotated 2-level structure can be +`optional`, `required`, or `required`. For backward-compatibility, the type of +elements in `LIST`-annotated structures should always be determined by the +following rules: 1. If the repeated field is not a group, then its type is the element type and - elements are required. + elements are required. In this case, `LIST` annotates a 2-level structure. 2. If the repeated field is a group with multiple fields, then its type is the - element type and elements are required. -3. 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. + element type and elements are required. In this case, `LIST` annotates a + 2-level structure and the element type is a Struct type with multiple fields. +3. If the repeated field is a group (not `LIST`-annotated) 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 (a single-field + Struct type) is the element type and elements are required. This is a special + case of 3-level structure where the names are respected. 4. Otherwise, the repeated field's type is the element type with the repeated - field's repetition. + field's repetition. In this case, `LIST` annotates a 2-level structure. Note + that the repeated field cannot be a 3-level LIST whose repetition must be Review Comment: ```suggestion that the repeated field cannot be a 3-level LIST, as such a list's repetition must be ``` ########## LogicalTypes.md: ########## @@ -648,49 +648,66 @@ optional group my_list (LIST) { } ``` -Some existing data does not include the inner element layer. For -backward-compatibility, the type of elements in `LIST`-annotated structures -should always be determined by the following rules: +Some existing data does not include the inner element layer, meaning that +`LIST` annotates a 2-level structure. In contrast to 3-level structure, The Review Comment: ```suggestion `LIST` annotates a 2-level structure. In contrast to the 3-level structure, the ``` -- 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: issues-unsubscr...@parquet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@parquet.apache.org For additional commands, e-mail: issues-h...@parquet.apache.org