Skip to main content

waratah_exec/
lib.rs

1//! Vectorized execution kernels for Waratah compute (Phase 9a–9c).
2//!
3//! Phase **9a** provides columnar [`TermColumn`] frames of query-local
4//! [`TermId`]s (`Vec<u32>`; `0` = SPARQL unbound). Production joins use
5//! [`hash_join_columnar`]; scalar [`hash_join`] is the same TermId kernel
6//! kept for parity tests. Bound vs unbound is `id != 0`. [`DistinctState`]
7//! deduplicates solution rows on those ids.
8//!
9//! Phase **9b** adds [`shuffle_hash_join`] (hash-partition then per-bucket
10//! TermId join). Broadcast filtering is applied at the storage scan
11//! boundary. Phase **9c** adds [`left_hash_join_columnar`] for SPARQL
12//! `OPTIONAL`, with scalar [`left_hash_join`] as an alias.
13//!
14//! Join semantics: equality on TermIds for hard keys, soft shared columns
15//! reconciled after candidate generation (SPARQL compatible mappings), unbound
16//! hard keys never match, smaller side as build (inner join), empty key list =
17//! cartesian. Left join always builds on the right.
18
19#![deny(unused_must_use)]
20#![warn(missing_docs)]
21
22mod column;
23mod distinct;
24mod error;
25mod join;
26mod semi_join;
27mod term_dict;
28
29pub use column::{TermBatch, TermColumn};
30pub use distinct::{DistinctState, key_wide, key1, key2, key3, key4, key5, key6, key7};
31pub use error::ExecError;
32pub use join::{
33    DEFAULT_SHUFFLE_PARTITIONS, JoinBuild, JoinCursor, JoinTableMode, LeftJoinIndexLists,
34    LeftJoinProbeDecision, LeftJoinProbeFilter, LeftJoinProbeMark,
35    gather_left_join_indices_columnar, hash_join, hash_join_build, hash_join_build_with,
36    hash_join_columnar, hash_join_columnar_capped, left_hash_join, left_hash_join_columnar,
37    left_hash_join_columnar_indices, parse_join_table_mode, shuffle_hash_join,
38};
39pub use semi_join::SemiJoinSet;
40pub use term_dict::{TermDict, TermId, counted_presence_encoded_term};