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
{{ message }}
Repository navigation
[MATLAB] arrow.array.BooleanArray's toMATLAB method does not take slice offsets into account #38630
Describe the bug, including details regarding any error messages, version, and platform.
While working on #38415, I noticed that the toMATLAB method of arrow.array.BooleanArray does not take the slice offset into account. This will cause the toMATLAB method to return the wrong value.
The same bug also manifests itself when accessing the Valid property on all sliced arrays. This is because both BooleanArray's toMATLAB method and the Valid getter function call arrow::matlab::bit::unpack(const std::shared_ptrarrow::Buffer& packed_buffer, int64_t length). This function calls VisitBitsUnrolled(const uint8_t* bitmap, int64_t start_offset, int64_t length, Visitor&& visit) with the assumption that start_offset is always 0. However, when the array has been sliced, start_offset will not be 0. Updating our unpack function to accept start_offset as input should fix both issues.
Activity
sgilmore10 commentedon Nov 7, 2023
take
sgilmore10 commentedon Nov 7, 2023
The same bug also manifests itself when accessing the Valid property on all sliced arrays. This is because both BooleanArray's toMATLAB method and the Valid getter function call arrow::matlab::bit::unpack(const std::shared_ptrarrow::Buffer& packed_buffer, int64_t length). This function calls VisitBitsUnrolled(const uint8_t* bitmap, int64_t start_offset, int64_t length, Visitor&& visit) with the assumption that start_offset is always 0. However, when the array has been sliced, start_offset will not be 0. Updating our unpack function to accept start_offset as input should fix both issues.
GH-38630: [MATLAB] `arrow.array.BooleanArray`'s `toMATLAB` method doe…
apacheGH-38630: [MATLAB] `arrow.array.BooleanArray`'s `toMATLAB` meth…
apacheGH-38630: [MATLAB] `arrow.array.BooleanArray`'s `toMATLAB` meth…