Skip to main content

laminar_core/
changelog.rs

1//! Z-set changelog encoding shared between the materialized-view producer
2//! (laminar-db) and the upsert-sink consumers (laminar-connectors).
3//!
4//! An aggregating MV emits one row per changed group carrying an Int64
5//! `WEIGHT_COLUMN`: `+n` inserts a value with multiplicity `n`, `-n` retracts
6//! it (a value change for key `K` is `{(K, V_old): -1, (K, V_new): +1}`). The
7//! column name lives here so the producer and consumers cannot drift on it.
8
9/// Name of the Int64 Z-set weight column appended to aggregating-MV changelog
10/// output. `+n` = insert with multiplicity `n`, `-n` = retract.
11pub const WEIGHT_COLUMN: &str = "__weight";