kevingurney opened a new pull request, #35551:
URL: https://github.com/apache/arrow/pull/35551
> **Warning** This pull request is dependent upon #35495 and #35491. We will
rebase and mark as ready for reviewer once that one is merged.
### Rationale for this change
In order to allow clients to write generic code for different concrete
`arrow.array.Array` subclasses in MATLAB, it would be helpful to have one
generic `toMATLAB` method. `toMATLAB` would convert the `arrow.array.Array`
into a corresponding MATLAB type.
For example, `arrow.array.Float64Array` would be converted to a MATLAB
`double` array.
```matlab
>> doubleMatlabArray = toMATLAB(float64ArrowArray) % Convert the
arrow.array.Float64Array to a MATLAB double array
```
### What changes are included in this PR?
1. Added a public `toMATLAB` method to the `arrow.array.Array` superclass.
Example of using `toMATLAB` on an `arrow.array.Float64Array`:
```matlab
>> arrowArray = arrow.array.Float64Array(1:10)
arrowArray =
[
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
]
>> matlabArray = toMATLAB(arrowArray)
matlabArray =
1
2
3
4
5
6
7
8
9
10
>> class(matlabArray)
ans =
'double'
```
### Are these changes tested?
1. Yes, we added tests for `toMATLAB` to `tFloat32Array.m` and
`tFloat64Array.m`.
2. This was qualified on a Debian 11 machine.
### Future Directions
1. Move the `toMATLAB` tests to the shared test utility class (i.e. #35537).
### Notes
1. Thanks to @sgilmore10 for her help with this pull request!
--
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]