GH-37812: [MATLAB] Add arrow.type.ListType MATLAB class#38189
Merged
kevingurney merged 20 commits intoapache:mainfrom Oct 11, 2023
Merged
GH-37812: [MATLAB] Add arrow.type.ListType MATLAB class#38189kevingurney merged 20 commits intoapache:mainfrom
arrow.type.ListType MATLAB class#38189kevingurney merged 20 commits intoapache:mainfrom
Conversation
2. Add list_type.cc to CMakeLists.txt sources.
2. Use libmexclass::proxy namespace. 3. Cast to `arrow::ListType`.
2. Add ListTraits.
2. Fix indentation of Struct type case.
…ng`. 2. Update `traits.m` to not include case for MATLAB `cell` type. 3. Update `tField.m` to include `arrow.list`. 4. Update `tID.m` to include `arrow.type.ID.List`. 5. Update `tTypeDisplay.m` to include `arrow.type.ListType`. 6. Update `ttraits.m` to include `arrow.type.traits.ListTraits`. 7. Add `tListTraits.m`.
sgilmore10
approved these changes
Oct 10, 2023
Member
sgilmore10
left a comment
There was a problem hiding this comment.
Thanks for adding this! Looks great!
kou
approved these changes
Oct 11, 2023
2. Add `ConstructionFcnTooManyInputsError` test.
Member
Author
|
+1 |
|
After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 852f09d. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this pull request
Nov 13, 2023
…he#38189) ### Rationale for this change In support of adding an [`arrow.array.ListArray`](apache#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`](apache#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. apache#37815 * Closes: apache#37812 Authored-by: Kevin Gurney <kgurney@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this pull request
Feb 19, 2024
…he#38189) ### Rationale for this change In support of adding an [`arrow.array.ListArray`](apache#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`](apache#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. apache#37815 * Closes: apache#37812 Authored-by: Kevin Gurney <kgurney@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
In support of adding an
arrow.array.ListArrayMATLAB class, this pull request adds a newarrow.type.ListTypeMATLAB class.What changes are included in this PR?
arrow.list(<type>)MATLAB construction function.arrow.list.ListTypeMATLAB class.ListTypehas a property namedTypewhich indicates the inner type of theList.Typecan be set to any subclassarrow.type.Type(includingarrow.type.ListType, to support nested lists).arrow.type.ID.Listtype ID enumeration value.arrow.type.traits.ListTraitstype traits class. Some of the properties, such asArrayConstructorandArrayProxyClassName, are set tomissingbecause they are dependent on addingarrow.array.ListArrayfirst.Example
Are these changes tested?
Yes.
tListType.m.tListTraits.m.tField.mto includearrow.list.tID.mto includearrow.type.ID.List.tTypeDisplay.mto includearrow.type.ListType.ttraits.mto includearrow.type.traits.ListTraits.Are there any user-facing changes?
Yes.
Client MATLAB code can now creates instances of
arrow.type.ListTypeby using thearrow.list(<type>)construction function.Future Directions
arrow.array.ListArrayMATLAB class #37815arrow.type.ListTypeMATLAB class #37812