|
sparrow-extensions 0.1.0
Extension types for the sparrow library
|
The Bool8 array is an Arrow-compatible array for storing boolean values using 8-bit storage according to the Apache Arrow canonical extension specification for Bool8.
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.
The Bool8 extension type is defined as:
arrow.bool8Int8false is denoted by the value 0true can be specified using any non-zero value (preferably 1)When <format> is available, Bool8 arrays can be formatted directly:
The Bool8 array automatically sets the following Arrow extension metadata:
ARROW:extension:name: "arrow.bool8"ARROW:extension:metadata: ""This metadata is added to the Arrow schema, allowing other Arrow implementations to recognize the array as containing Bool8 values.
The bool8_array type is an alias for sparrow::primitive_array<int8_t, simple_extension<"arrow.bool8">, bool>, providing all the functionality of a primitive array with Bool8-specific extension metadata and boolean value semantics.
| Feature | Description |
|---|---|
| Storage type | int8_t |
| Value type | bool |
| Extension name | "arrow.bool8" |
| Null support | Yes, via validity bitmap |
When compiled with C++20 <format> support, the following are available:
| Function | Description |
|---|---|
std::formatter<bool8_array> | Formatter specialization for std::format |
operator<<(std::ostream&, const bool8_array&) | Stream output operator |