Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bool8 #211

Closed
v1gnesh opened this issue Aug 5, 2024 · 3 comments
Closed

Bool8 #211

v1gnesh opened this issue Aug 5, 2024 · 3 comments

Comments

@v1gnesh
Copy link

v1gnesh commented Aug 5, 2024

Hey, I love seeing the recent updates. Hope you're doing well 🤝

When the new Bool8 type lands, please can you see if that can be added?

apache/arrow#43234
apache/arrow#43488
apache/arrow#43323

@chmp
Copy link
Owner

chmp commented Aug 5, 2024

Hey :)

Sure. As it's simply bools encoded as a 0/1 in a Int8 array, it should be a pretty trivial change. (simply add bool support to the int deserializers / serializers). The extension type itself is ignored by the serde_arrow at the moment.

At the moment I am midway through a major change of the internals of serde_arrow, but I should be able to add this change afterwards.

@chmp
Copy link
Owner

chmp commented Aug 7, 2024

Details from the PR defining the extension type:

Bool8 represents a boolean value using 1 byte (8 bits) to store each value instead of only 1 bit as in the original Arrow Boolean type. Although less compact than the original representation, Bool8 may have better zero-copy compatibility with various systems that also store booleans using 1 byte.

  • Extension name: arrow.bool8.
  • The storage type of this extension is Int8 where:
    • false is denoted by the value 0.
    • true can be specified using any non-zero value. Preferably 1.
  • Extension type parameters: This type does not have any parameters.
  • Description of the serialization: Metadata is an empty string.

Impls:

  • Test that bool can serialized / deserialized into I8 arrays
  • Test that any non-zero value is deserialized as true
  • Implement extension type

@chmp chmp mentioned this issue Aug 7, 2024
4 tasks
@chmp
Copy link
Owner

chmp commented Aug 8, 2024

Implemented with #212 and #214

@chmp chmp closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants