package granary
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8b18780ea373be48301d9f333925860a2f9110fc0ac28684295118d72b65a67e
sha512=25ca3c9c5e2b528704a542502e0f37dc33ba003f65622d969b8c2b800778585f8ef0cf89b36e6679832e3993e8303aecddfc662742baf7044d6afe4a796b8f11
doc/granary.encoding/Granary_encoding/Null_bitmap/index.html
Module Granary_encoding.Null_bitmapSource
Bitmap helpers for null-mask encoding.
Used by Granary_columnar.Col for columnar null bitmaps. Intended to also replace the inline bitmap logic in Granary_encoding.Row once the API is adapted (see issue #372).
val pack_bits :
(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t ->
int ->
bytespack_bits bits n packs the first n elements of bits into a big-endian bitmask byte string. Each byte encodes 8 entries: bit 0 of byte 0 = bits0, bit 1 = bits1, etc.
val pack_bits_into :
Buffer.t ->
(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t ->
int ->
unitpack_bits_into buf bits n writes a packed bitmask directly into buf, one byte per 8 entries, without materialising an intermediate Bytes.t.
val unpack_bits :
bytes ->
int ->
int ->
(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.tunpack_bits buf off n reads ceil(n/8) bytes from buf starting at off and unpacks them into a fresh bigarray of length n.
pack_bits_of_bools is_null n packs the predicate is_null applied to indices 0, n-1 into a big-endian bitmask byte string. Each byte encodes 8 entries: bit 0 of byte 0 = is_null(0), bit 1 = is_null(1), etc.
unpack_bits_to_bools buf off n reads ceil(n/8) bytes from buf at off and returns a bool array of length n where element i is true iff bit i of the bitmask is set.