Skip to content

[Format] Is Buffer lengths buffer REQUIRED in C data format of BinaryView #43989

Closed

Description

@robert3005

Describe the bug, including details regarding any error messages, version, and platform.

C Data interface section on BinaryView mentions that this array type requires an additional buffer to be produced when sending the array. However, it doesn't mention whether that addtional array always has to be present even if there's no data buffers. This could happen for example if your array only contains short strings.

For reference the implementation assumes there are at least 3 buffers which I assume is view, nulls and buffer lengths

if (c_struct_->n_buffers < 3) {

Component(s)

Format

Activity

  1. mapleFU commented on Sep 6, 2024

    @mapleFU
    Member

    94fc124

    I think it's mentioned in the docs/source/format/CDataInterface.rst?

  2. robert3005 commented on Sep 6, 2024

    @robert3005
    ContributorAuthor

    Ok, so the correct interpretation of the docs I had linked https://arrow.apache.org/docs/format/CDataInterface.html#binary-view-arrays is that there MUST be a length buffer even if there are no data buffers?

  3. mapleFU commented on Sep 6, 2024

    @mapleFU
    Member
  4. bkietz commented on Sep 6, 2024

    @bkietz
    Member

    When I wrote it, it was my intent that the lengths buffer always be present even if there were no data buffers. In that case, there would be exactly three buffers: validity, views, and lengths. However if there are no data buffers the lengths buffer would be empty, present only to give the array correct layout.

  5. robert3005 commented on Sep 6, 2024

    @robert3005
    ContributorAuthor

    When I started looking it made sense that it must be present. Thanks, I might make a small docs pr but this answers my question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions