Skip to main content

Module partitioned_topk

Module partitioned_topk 

Source
Expand description

§Partitioned Top-K Operator

Per-group top-K supporting the ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ...) WHERE rn <= N pattern. Each partition key gets an independent top-K heap.

§Memory Bounds

Memory is O(P * K) where P = distinct partitions, K = per-partition limit. A max_partitions safety limit prevents unbounded partition growth.

§Emit Strategies

Same as the global top-K: OnUpdate, OnWatermark, or Periodic. Changelog records are emitted per-partition.

Structs§

PartitionColumn
Configuration for a partition key column.
PartitionedTopKOperator
Partitioned top-K operator.