Commits


Kevin Gurney authored and GitHub committed 852f09d54b4
GH-37812: [MATLAB] Add `arrow.type.ListType` MATLAB class (#38189) ### Rationale for this change In support of adding an [`arrow.array.ListArray`](https://github.com/apache/arrow/issues/37815) MATLAB class, this pull request adds a new `arrow.type.ListType` MATLAB class. ### What changes are included in this PR? 1. New `arrow.list(<type>)` MATLAB construction function. 2. New `arrow.list.ListType` MATLAB class. `ListType` has a property named `Type` which indicates the inner type of the `List`. `Type` can be set to any subclass `arrow.type.Type` (including `arrow.type.ListType`, to support nested lists). 3. New `arrow.type.ID.List` type ID enumeration value. 4. New `arrow.type.traits.ListTraits` type traits class. Some of the properties, such as `ArrayConstructor` and `ArrayProxyClassName`, are set to `missing` because they are dependent on adding [`arrow.array.ListArray`](https://github.com/apache/arrow/issues/37815) first. **Example** ```matlab % Create a simple List<String> type. >> stringListType = arrow.list(arrow.string()) stringListType = ListType with properties: ID: List Type: [1x1 arrow.type.StringType] % Create a nested List<List<Boolean>> type. >> nestedListType = arrow.list(arrow.list(arrow.boolean())) nestedListType = ListType with properties: ID: List Type: [1x1 arrow.type.ListType] % Extract the first-level, inner type, which is List<Boolean>. >> innerType = nestedListType.Type innerType = ListType with properties: ID: List Type: [1x1 arrow.type.BooleanType] % Extract the second-level, nested inner type, which is Boolean. >> innerType.Type ans = BooleanType with properties: ID: Boolean ``` ### Are these changes tested? Yes. 1. Added `tListType.m`. 2. Added `tListTraits.m`. 3. Updated `tField.m` to include `arrow.list`. 4. Updated `tID.m` to include `arrow.type.ID.List`. 6. Updated `tTypeDisplay.m` to include `arrow.type.ListType`. 7. Updated `ttraits.m` to include `arrow.type.traits.ListTraits`. ### Are there any user-facing changes? Yes. Client MATLAB code can now creates instances of `arrow.type.ListType` by using the `arrow.list(<type>)` construction function. ### Future Directions 1. #37815 * Closes: #37812 Authored-by: Kevin Gurney <kgurney@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>