Skip to content
20 changes: 18 additions & 2 deletions encodings/pivco-bytes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
//! sparse filters and takes decode only the blocks their rows span, `==` and `!=` against a
//! constant decode only the rows of its length, and byte length reads the offsets alone.
//!
//! Both encodings are members of the `unstable` edition: their wire formats may change. Register
//! [`PivcoTokens`] codes `u16` columns with more than 256 distinct values, such as substring
//! dictionary token codes: the high bytes are one [`PivcoBytesArray`] child, and the low bytes are
//! grouped by their high byte into one [`PivcoBytesArray`] child each, so that every group gets a
//! tree of its own.
//!
//! All three encodings are members of the `unstable` edition: their wire formats may change. Register
//! them with [`initialize`]:
//!
//! ```rust
Expand All @@ -49,6 +54,7 @@ mod array;
mod compute;
mod plugin;
mod string;
mod tokens;

pub use array::DEFAULT_BLOCK_SIZE;
pub use array::PivcoBytes;
Expand All @@ -69,6 +75,14 @@ pub use string::PivcoStringData;
pub use string::PivcoStringMetadata;
pub use string::PivcoStringSlots;
pub use string::pivco_string_id;
pub use tokens::MIN_CODED_GROUP_LEN;
pub use tokens::PivcoTokens;
pub use tokens::PivcoTokensArray;
pub use tokens::PivcoTokensArrayExt;
pub use tokens::PivcoTokensData;
pub use tokens::PivcoTokensMetadata;
pub use tokens::PivcoTokensParts;
pub use tokens::pivco_tokens_id;
use vortex_array::ArrayVTable;
use vortex_array::arrays::Dict;
use vortex_array::arrays::Filter;
Expand All @@ -87,7 +101,7 @@ use vortex_functions::byte_length::ByteLength;
use vortex_functions::byte_length::ByteLengthExecuteAdaptor;
use vortex_session::VortexSession;

/// Registers the `vortex.pivco_bytes` and `vortex.pivco_string` encodings, their slice and cast
/// Registers the `vortex.pivco_bytes`, `vortex.pivco_string` and `vortex.pivco_tokens` encodings, their slice and cast
/// rules and their filter, take, compare and byte length kernels with the session.
pub fn initialize(session: &VortexSession) {
session.register_array(PivcoBytes, PivcoBytes);
Expand Down Expand Up @@ -136,6 +150,8 @@ pub fn initialize(session: &VortexSession) {
PivcoString,
ByteLengthExecuteAdaptor(PivcoString),
);

session.register_array(PivcoTokens, PivcoTokens);
}

#[cfg(test)]
Expand Down
Loading