Expand description
§BooleanArray Module - Mid-Level, Inner Typed Boolean Array
BooleanArray is an Arrow-compatible, bit-packed boolean array implementation with optional null-mask support, 64-byte alignment, and efficient memory layout for analytical workloads.
§Overview
- Logical type: boolean values (
true/false) with optionalnullstate. - Physical storage: bit-packed
Bitmaskfor values, optionalBitmaskfor validity. - Backed by
Vec64<u8>-aligned buffers for CPU-friendly operations. - Integrates with Arrow FFI and MaskedArray trait for schema-agnostic use.
§Features
- Construction from raw bitmasks, byte buffers, or boolean slices.
- Mutation: bulk bit writes, per-element set, push, null insertion.
- Iteration: sequential and parallel (with
parallel_procfeature). - Null handling: optional validity mask with auto-growth and validation.
- Slicing: zero-copy tuple views or cloned logical slices.
§Intended Use Cases
- High-performance analytical pipelines requiring dense boolean representation.
- Interop with Apache Arrow or other columnar formats.
- Streaming or batch ingestion with incremental append.
§Performance Notes
- Bulk operations (
set_bits_chunk,push_bits) are preferred over per-element writes. - Avoid
getin tight loops when null-free; use iterators orget_unchecked. - Parallel iteration requires the
parallel_procfeature.
§Related Types
Bitmask: underlying storage type for values and nulls.MaskedArray: trait defining the nullable array API.Vec64: heap storage type for 64-byte aligned vectors.
Structs§
- Boolean
Array - BooleanArray