Skip to main content

zu_vector/
lib.rs

1//! Typed columnar vectors and expression kernels (Spec/2064g/perf/02).
2//!
3//! The executor's tuple representation today is a Vec<Vec<Value>> with a
4//! 32-byte tagged enum per cell. This crate replaces the cell type with
5//! typed vectors: one contiguous buffer per column, validity as a bitmap,
6//! filters as selection vectors, strings as 16-byte views into shared
7//! buffers, and dictionary columns flowing as integer codes end to end.
8//! All vector memory comes from a per-morsel bump arena, so steady-state
9//! operator paths allocate nothing.
10//!
11//! The factorized execution model is unchanged; only the bones are new.
12//! The old executor keeps running while this crate lands standalone, then
13//! the perf/03 executor consumes it natively.
14
15mod arena;
16mod bitmap;
17mod chunk;
18mod expr;
19pub mod kernels;
20mod sel;
21mod str;
22mod vector;
23
24pub use arena::{BLOCK_BYTES, MorselArena, Pod, PooledArena, RawBuf};
25pub use bitmap::Bitmap;
26pub use chunk::{ChunkSet, DataChunk};
27pub use expr::{ExprOp, OwnedValue, Program, Reg, const_str};
28pub use kernels::{
29    BinOp, CmpOp, MathOp, MathPair, StrCut, StrFold, StrLen, StrNorm, StrTrim, TrimSet,
30};
31pub use sel::SelVector;
32pub use str::{Dictionary, INLINE_LEN, NO_BUFFERS, StrBuffers, StrBuilder, StrView};
33pub use vector::{
34    Aux, PhysType, ValueVector, VecEncoding, node_group, node_ref, node_row, node_table,
35    str_vector, str_vector_from_ends,
36};
37
38/// Rows per vector, unchanged from the executor's chunk fill width.
39/// A u16 selection index covers it with room to spare, and one vector
40/// spans exactly two of the storage layer's 1024-row decode chunks.
41pub const VECTOR_SIZE: usize = 2048;