Commits


sgilmore10 authored and GitHub committed e32e87529e0
GH-37654: [MATLAB] Add `Fields` property to `arrow.type.Type` MATLAB class (#37725) ### Rationale for this change In order to implement `arrow.array.StructType`, we need to add a property called `Fields` to `arrow.type.Type`. This property will be a N-by-1 `arrow.type.Field` array. Adding `Fields` will let users inspect the `Type`s contained by a `StructType` object. ### What changes are included in this PR? 1. Added `Fields` as a property to `arrow.type.Type`. `Fields` is a 1xN `arrow.type.Field` array, where `N` is the number of fields. 2. Added method `field(idx)` to `arrow.type.Type`. This method accepts a numeric index and returns the `arrow.type.Field` stored at the specified index. ### Are these changes tested? 1. Yes, updated `hFixedWidthType.m` and `tStringType.m` to verify the behavior of the new property and method. 2. Currently, all of the concrete `arrow.type.Type`s do not have any fields. This means the `Fields` property is always a 0x0 `arrow.type.Field` array. Once we implement `StructType`, we will be able to test having a nonempty `Fields` property. ### Are there any user-facing changes? Yes, users can now extract fields from an `arrow.type.Type` object. ### Future Directions 1. #37724 2. #37653 * Closes: #37654 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>