Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-3478

[C++] API add value / null mask buffer accessor to ArrayData

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: C++
    • Labels:
      None

      Description

      Currently, the ArrayData struct has the `std::vector<Buffer> buffers` member.

      The buffers will (from reading the code) either be [null_mask, data] or [data] (if the null mask does not exist).

      I'm not sure if there is an easy way to get the null mask reliably at the moment. If I am understanding correctly, the way to do it right now is to check if the vector has one or two elements, and then use `buffers[0]` as the null mask, and `buffers[1]` as the values.

      I also did not find information regarding this in the spec. So I am not sure if I can rely on this behavior in future versions of the library.

      I am wondering wether adding explicit API for this would make this more reliable. 

       

      For example two more interface functions

      • `std::shared_ptr<Buffer> mask()`
      • `std::shared_ptr<Buffer> values()` 

      Would make it easy for me to rely on the interface to "do the right thing".

       

      Or am I missing something?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              wolfv Wolf Vollprecht
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: