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
We've added support for null values to arrow.array.Float64Array via the InferNulls and Valid name-value pairs. We would like to add these name-value pairs to the rest of the numeric array classes:
arrow.array.Float32Array
arrow.array.UInt8Array
arrow.array.UInt16Array
arrow.array.UInt32Array
arrow.array.UInt64Array
arrow.array.Int8Array
arrow.array.Int16Array
arrow.array.Int32Array
arrow.array.Int64Array
Component(s)
MATLAB
The text was updated successfully, but these errors were encountered:
sgilmore10
changed the title
[MATLAB] Add null support to all numeric array classes.
[MATLAB] Add null support to all numeric array classes
Jun 8, 2023
)
### Rationale for this change
We initially only enabled null support for `arrow.array.Float64Array` via the `InferNulls` and `Valid` name-value pairs. This pull request adds null-value support to the rest of the numeric array types.
### What changes are included in this PR?
1. All numeric array classes accept the `InferNulls` and `Valid` name-value pairs.
2. `arrow.array.Float32Array` treats `NaN` as `null` by default if `InferNulls=true` and `Valid` is not supplied.
3. To reduce code duplication, we added an abstract class called `arrow.array.NumericArray` that all numeric array classes inherit form.
Here's an example of creating an `Int32Array` with `null` values:
```MATLAB
>> matlabArray = int32([1 2 3 4 5]);
>> arrowArray = arrow.array.Int32Array(matlabArray, Valid=[1 4 5])
arrowArray =
[
1,
null,
null,
4,
5
]
```
### Are these changes tested?
1. Added two unit tests to `hNumericArray.m` called `LogicalValidNVPair` and `NumericValidNVPair` which test the null support integration of all numeric types.
2. Added unit tests to `tFloat32Array.m` to verify `NaN `is treated as a null value by default.
### Are there any user-facing changes?
Yes, users can now create numeric arrays of any type with null values.
### Notes
Thanks to @ kevingurney for all the help!
* Closes: #35984
Authored-by: Sarah Gilmore <sgilmore@mathworks.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Describe the enhancement requested
We've added support for null values to
arrow.array.Float64Array
via theInferNulls
andValid
name-value pairs. We would like to add these name-value pairs to the rest of the numeric array classes:arrow.array.Float32Array
arrow.array.UInt8Array
arrow.array.UInt16Array
arrow.array.UInt32Array
arrow.array.UInt64Array
arrow.array.Int8Array
arrow.array.Int16Array
arrow.array.Int32Array
arrow.array.Int64Array
Component(s)
MATLAB
The text was updated successfully, but these errors were encountered: