Commits


sgilmore10 authored and GitHub committed faccbeff6e8
GH-37337: [MATLAB] Add `arrow.array.Time64Array` class (#37368) ### Rationale for this change Now that `arrow.type.Time64Type` class has been added to the MATLAB Interface (#37287), we can add the `arrow.array.Time64Array` class. ### What changes are included in this PR? 1. New `arrow.array.Time64Array` class. 2. New `arrow.type.traits.Time64Traits` class. 3. Enhanced `arrow.array(data)` to return a `arrow.array.Time64Array` instance if the input `data` is a MATLAB `duration` array. The MATLAB `duration` type represents length of time in fixed-length units. 4. Enhanced `arrow.type.traits.traits(id)` to return an `arrow.type.traits.Time64Traits` instance if `id` is an `arrow.type.ID.Time64` value or equal to the string `"duration".` 5. Updated the test utility `arrow.internal.test.tabular.createAllSupportedArrayTypes()` to include an `arrow.array.Time64Array` instance in its output. 6. Updated the test utility `arrow.internal.test.tabular.createTableWithSupportedTypes()` to include a `duration` variable on the returned `table`. 7. Updated the README.md to include `Time32Array` and `Time64Array`. **Example Usage** ```matlab % Create a duration array >> ms = milliseconds([100 150 1001]) ms = 1×3 duration array 0.1 sec 0.15 sec 1.001 sec % Create an arrow.type.Time64Array >> time = arrow.array(ms) time = [ 00:00:00.100000, 00:00:00.150000, 00:00:01.001000 ] % Create a duration array from an arrow.array.Time64Array >> data = duration(time) data = 3×1 duration array 0.1 sec 0.15 sec 1.001 sec ``` ### Are these changes tested? Yes. 1. Added a new test class `tTime64Array.m`. 2. Added a new test class `tTime64Traits.m` 3. Added new test cases to `tArray.m` and `ttraits.m` ### Are there any user-facing changes? Yes. Users can now create `arrow.array.Time64Array`s from MATLAB `duration`s * Closes: #37337 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>