Skip to content

[MATLAB] arrow.array.BooleanArray's toMATLAB method does not take slice offsets into account #38630

Closed

Description

@sgilmore10

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.

Component(s)

MATLAB

Activity

  1. sgilmore10 commented on Nov 7, 2023

    @sgilmore10
    MemberAuthor

    take

  2. sgilmore10 commented on Nov 7, 2023

    @sgilmore10
    MemberAuthor

    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.

  3. added a commit that references this issue on Nov 9, 2023
  4. moved this from Backlog to Done in Arrow MATLABon Nov 9, 2023
  5. added this to the 15.0.0 milestone on Nov 9, 2023
  6. added a commit that references this issue on Nov 13, 2023
  7. added a commit that references this issue on Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions