sgilmore10 opened a new pull request, #35562:
URL: https://github.com/apache/arrow/pull/35562
> **Warning** This pull request is dependent upon #35556. We will rebase and
mark as ready for review once that one is merged.
### Rationale for this change
Followup to #35495 in which we added the MATLAB class `Float32Array`.
This pull request adds support for round tripping signed integer between
`arrow.array.<Type>Array` classes and associated MATLAB types (e.g. `uint8`,
`uint16`, `uint32`, `uint64`).
| Arrow Array Type | MATLAB Type |
| ----------------- | -------------- |
| `UInt8Array` | `uint8`|
| `UInt16Array` | `uint16`|
| `UInt32Array` | `uint32`|
| `UInt64Array` | `uint64`|
Example of round-tripping `uint8` data:
```matlab
>> uint8MATLABArray = uint8([1 2 3]')
uint8MATLABArray =
3×1 uint8 column vector
1
2
3
>> uint8ArrowArray = arrow.array.UInt8Array(uint8MATLABArray)
uint8ArrowArray =
[
1,
2,
3
]
>> uint8MATLABArrayRoundTripped = toMATLAB(uint8ArrowArray)
uint8MATLABArrayRoundTripped =
3×1 uint8 column vector
1
2
3
>> all(uint8MATLABArray == uint8MATLABArrayRoundTripped)
ans =
logical
1
```
### What changes are included in this PR?
Added four new unsigned integer type `arrow.array.<Array>` concrete
subclasses.
1. `arrow.array.UInt8Array`
2. `arrow.array.UInt16Array`
3. `arrow.array.UInt32Array`
4. `arrow.array.UInt64Array`
### Are these changes tested?
Yes, we added the following four test classes:
1. `tUInt8Array.m`
2. `tUInt16Array.m`
3. `tUInt32Array.m`
4. `tUInt64Array.m`
### Are there any user-facing changes?
Yes. This change introduces 4 new publicly documented classes:
1. `arrow.array.UInt8Array`
2. `arrow.array.UInt16Array`
3. `arrow.array.UInt32Array`
4. `arrow.array.UInt64Array`
### Future Directions
1. Add support for null values (i.e. validity bitmap) for the unsigned
integer array types.
### NOTES
1. Thank you to @kevingurney for his help with this PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]