rdblue commented on code in PR #466:
URL: https://github.com/apache/parquet-format/pull/466#discussion_r1835182164
##########
LogicalTypes.md:
##########
@@ -648,49 +650,105 @@ 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:
+##### 2-level structure
+
+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 2-level structure can be `optional`, `required`, or `repeated`.
+
+```
+<list-repetition> group <name> (LIST) {
+ repeated <element-type> <element-name>;
+}
+```
+
+For backward-compatibility, the type of elements in `LIST`-annotated 2-level
+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.
-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.
-4. Otherwise, the repeated field's type is the element type with the repeated
- field's repetition.
+2. If the repeated field is a group with multiple fields, then its type (Struct
+ type with multiple fields) is the element type and elements are required.
+3. If the repeated field is a group with one `required` or `optional` field,
Review Comment:
This rule should not be modified with new cases. I think we need to insert a
new rule that states if the repeated field is a group with a `repeated` field,
the repeated field is the element type because the type cannot be a 3-level
list.
The rules should be as independent as possible and I think it makes it more
confusing to mix them together like this and like the new #4.
--
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]