Skip to content

[protocol] USE_BITMASK is ambiguous #252

Description

@pitrou

The description for USE_BITMASK does not specify in which order the bits of a byte are to be considered (from MSB to LSB or LSB to MSB).

FTR, Arrow goes from LSB to MSB, i.e. bit 0 representents the validity of the first array element, bit 1 the second element, and so on:

>>> a = pa.array([1, None, 2, 3])
>>> a.buffers()
[<pyarrow.Buffer address=0x7f3dc8209000 size=1 is_cpu=True is_mutable=True>,
 <pyarrow.Buffer address=0x7f3dc8209040 size=32 is_cpu=True is_mutable=True>]
# buffer 0 is the validity bitmap
>>> bin(a.buffers()[0][0])
'0b1101'

Activity

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