Expand description
§Streaming Top-K Operator
Bounded heap of top-K items with retraction-based changelog emission.
Supports ORDER BY ... LIMIT N on unbounded streams by maintaining
a sorted buffer of at most K entries. New events that rank within the
top-K cause eviction of the worst entry and optional rank-change
retractions.
§Emit Strategies
OnUpdate: Emit changelog on every state change (lowest latency)OnWatermark: Buffer changes, emit on watermark advancePeriodic(interval): Emit on timer interval
§Ring 0 Constraints
entriespre-allocated to capacity K — no reallocation duringprocess()- Sort keys use
Vec<u8>memcomparable encoding for zero-branch comparison - Sorted Vec with binary search: O(log K) search + O(K) shift
Structs§
- Streaming
TopK Operator - Streaming top-K operator for
ORDER BY ... LIMIT N. - TopK
Sort Column - Configuration for a sort column in the top-K operator.
Enums§
- TopK
Emit Strategy - Emit strategy for the streaming top-K operator.
Functions§
- encode_
f64 - Encodes an f64 value as memcomparable bytes.
- encode_
i64 - Encodes an i64 value as memcomparable bytes.
- encode_
not_ null - Encodes a non-null value marker into the sort key.
- encode_
null - Encodes a null value marker into the sort key.
- encode_
utf8 - Encodes a UTF-8 string as memcomparable bytes.