You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…nt8Array`, `UInt16Array`, `UInt32Array`, `UInt64Array`) (#35562)
### 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!
* Closes: #35557
Lead-authored-by: Sarah Gilmore <sgilmore@mathworks.com>
Co-authored-by: Kevin Gurney <kgurney@mathworks.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Describe the enhancement requested
Followup to #35495 in which we added the MATLAB class
Float32Array
.UInt8Array
uint8
UInt16Array
uint16
UInt32Array
uint32
UInt64Array
uint64
Component(s)
MATLAB
The text was updated successfully, but these errors were encountered: