Skip to content

Commit

Permalink
apacheGH-465: Clarify backward-compatibility rules on LIST type
Browse files Browse the repository at this point in the history
  • Loading branch information
wgtmac committed Oct 30, 2024
1 parent 4f20815 commit 1798de7
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions LogicalTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -654,13 +654,17 @@ 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.
2. If the repeated field is a group with multiple fields, then its type (i.e.
a multi-field Tuple) 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.
or uses the `LIST`-annotated group's name with `_tuple` appended, then the
repeated type is the element type and elements are required. Note that the
element type is a List or Map type if `LIST`-annotated or `MAP`-annotated,
or a single-field Tuple when not annotated.
4. Otherwise, the repeated field's type is the element type with the repeated
field's repetition.
field's repetition and elements are required. Note that the element type is
a List or Map type if `LIST`-annotated or `MAP`-annotated, or a Tuple type
otherwise.

Examples that can be interpreted using these rules:

Expand Down Expand Up @@ -691,6 +695,14 @@ optional group my_list (LIST) {
required binary str (STRING);
};
}
// List<List<Integer>> (outer list is nullable with non-null elements,
// inner list is non-null with non-null elements)
optional group my_list (LIST) {
repeated group array (LIST) {
repeated int32 array;
}
}
```

### Maps
Expand Down

0 comments on commit 1798de7

Please sign in to comment.