Commits


Kevin Gurney authored and GitHub committed fbe5f641d32
GH-35558: [MATLAB] Add signed integer array MATLAB classes (i.e. `Int8Array`, `Int16Array`, `Int32Array`, `Int64Array`) (#35561) ### Rationale for this change Followup to https://github.com/apache/arrow/pull/35495 in which we added the MATLAB class `Float32Array`. This pull request adds support for round tripping signed integer between `arrow.array.<Array>` classes and associated MATLAB types (e.g. `int8`, `int16`, `int32`, `int64`). | Arrow Array Type | MATLAB Type | | ------------------------- | -------------------- | | `Int8Array` | `int8` | | `Int16Array` | `int16` | | `Int32Array` | `int32` | | `Int64Array` | `int64` | Example of round-tripping `int8` data: ```matlab >> int8MatlabArray = int8([1, 2, 3]') int8MatlabArray = 3x1 int8 column vector 1 2 3 >> int8ArrowArray = arrow.array.Int8Array(int8MatlabArray) int8ArrowArray = [ 1, 2, 3 ] >> int8MatlabArrayRoundTripped = toMATLAB(int8ArrowArray) int8MatlabArrayRoundTripped = 3x1 int8 column vector 1 2 3 >> all(int8MatlabArray == int8MatlabArrayRoundTripped) ans = logical 1 ``` ### What changes are included in this PR? Added four new signed integer type `arrow.array.<Array>` concrete subclasses. 1. `arrow.array.Int8Array` 3. `arrow.array.Int16Array` 4. `arrow.array.Int32Array` 5. `arrow.array.Int64Array` ### Are these changes tested? Yes, we added the following four test classes: 1. `tInt8Array.m` 2. `tInt16Array.m` 3. `tInt32Array.m` 4. `tInt64Array.m` ### Are there any user-facing changes? Yes. This change introduces 4 new publicly documented classes: 1. `arrow.array.Int8Array` 3. `arrow.array.Int16Array` 4. `arrow.array.Int32Array` 5. `arrow.array.Int64Array` ### Future Directions 1. Add support for null values (i.e. validity bitmap) for the signed integer array types. ### Notes !. Thank you to @ sgilmore10 for her help with this pull request! * Closes: #35558 Lead-authored-by: Kevin Gurney <kgurney@mathworks.com> Co-authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>