sgilmore10 opened a new pull request, #35479:
URL: https://github.com/apache/arrow/pull/35479
### Rationale for this change
This pull request is a followup to #34563. To facilitate the implementation
of future array types, we would like to first create a C++ template class for
numeric arrays. We also want to start adding basic tests for the array
functionality in the MATLAB interface.
### What changes are included in this PR?
1. Added a C++ template Class called `NumericArray` templated on `CType`.
2. Re-implemented the `Float64Array` C++ proxy class in terms of the new
template class, i.e. `NumericArray<double>`.
3. Added a method called `double()` on the MATLAB Float64Array class to
convert the arrow.[Type]Array to a MATLAB `double` array.
4. Added basic tests for round-tripping float64 arrays.
5. Created a base C++ proxy `Array` class that all proxy array classes will
inherit from.
6. Renamed `Print()` to `ToString()` and made it return a string instead of
printing to the screen.
### Are these changes tested?
Yes, we added automated test cases to the test class `tFloat64Array.m`. In
addition, we manually qualified these changes on macOS.
### Are there any user-facing changes?
Yes, the `Print()` method is no longer public and there is now a method
called `double()` on `arrow.array.Float64Array`.
Included below is a simple example of using the `double()` method:
```matlab
>> arrowArray = arrow.array.Float64Array([1, 2, 3])
arrowArray =
[
1,
2,
3
]
>> matlabArray = double(arrowArray)
matlabArray =
1
2
3
>> class(arrowArray)
ans =
'arrow.array.Float64Array'
>> class(matlabArray)
ans =
'double'
```
### Future Directions
We will add support for
1. The rest of the numeric types.
2. Continue building out the methods (e.g. `length()`)
3. `null` values (validity bitmap).
4. Converting non-ascii characters from `UTF-8` to `UTF-16`.
5. Error handling.
--
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]