Commits


sgilmore10 authored and GitHub committed a7f5ee01b59
GH-37724: [MATLAB] Add `arrow.type.StructType` MATLAB class (#37749) ### Rationale for this change In order to add a `arrow.array.StructArray` MATLAB class (https://github.com/apache/arrow/issues/37653), we first need to implement the `arrow.type.StructType` MATLAB class. ### What changes are included in this PR? 1. Added a new MATLAB class `arrow.type.StructType` 2. Added convenience constructor function `arrow.struct()` 3. Added `Struct` as a enumeration value to `arrow.type.ID` 4. Added `arrow.type.traits.StructTraits` MATLAB class. Some of its properties, such as `ArrayConstructor` and `ArrayProxyClassName`, are set to `missing` because they require `arrow.array.StructArray` (#37653). When that class is added, we can initialize these properties to correct values. **Example Usage** ```matlab >> fieldA = arrow.field("A", arrow.int32()); >> fieldB = arrow.field("B", arrow.timestamp(TimeZone="America/New_York")); >> fieldC = arrow.field("C", arrow.string()); >> structType = arrow.struct(fieldA, fieldB, fieldC) structType = StructType with properties: ID: Struct Fields: [1×3 arrow.type.Field] >> fieldBFromStruct = structType.field(2) fieldBFromStruct = B: timestamp[us, tz=America/New_York] ``` ### Are these changes tested? Yes. 1. Added a new test class called `tStructType.m` 2. Added a new test case to `tTypeDisplay.m` 3. Updated test case in `tID.m` ### Are there any user-facing changes? Yes. Users can now create an `arrow.type.StructType` object using the new `arrow.struct()` funciton. ### Future Directions 1. #37653 * Closes: #37724 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>