Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions data_plane/src/precompute_engine/accumulator_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,8 @@ pub fn config_is_keyed(config: &AggregationConfig) -> bool {
| AggregationType::MultipleMinMax
| AggregationType::CountMinSketch
| AggregationType::CountMinSketchWithHeap
| AggregationType::CountSketch
| AggregationType::CountSketchWithHeap
| AggregationType::HydraKLL
)
}
Expand Down Expand Up @@ -730,6 +732,26 @@ pub fn create_accumulator_updater(config: &AggregationConfig) -> Box<dyn Accumul
let (row_num, col_num) = cms_params(config);
Box::new(CmsAccumulatorUpdater::new(row_num, col_num))
}
// CountSketch + CountSketchWithHeap (raw-input ingest path):
// route to `CmsAccumulatorUpdater` for now — it handles the
// same `(rows, cols)` matrix shape. The OTLP modified-sketch
// wire path uses `SketchEnvelope` ingest (not raw), so this
// arm fires only for Mode 2 / raw-input policies.
//
// Limitation: like the `CountMinSketchWithHeap` arm above,
// this drops the per-policy top-k heap on the raw-input side.
// The heap-bearing accumulator
// (`count_min_sketch_with_heap_accumulator.rs`) exists but
// doesn't yet have an `AccumulatorUpdater` impl; same is
// true for the CountSketch variants. Adding dedicated
// updaters is tracked as a follow-up — the present arm is
// a correctness floor (registered policy → working
// accumulator) without silently falling through to
// `SumAccumulatorUpdater`.
AggregationType::CountSketch | AggregationType::CountSketchWithHeap => {
let (row_num, col_num) = cms_params(config);
Box::new(CmsAccumulatorUpdater::new(row_num, col_num))
}
AggregationType::HydraKLL => {
let (row_num, col_num, k) = hydra_kll_params(config);
Box::new(HydraKllAccumulatorUpdater::new(row_num, col_num, k))
Expand Down Expand Up @@ -882,6 +904,18 @@ mod tests {
AggregationType::CountMinSketch,
""
)));
assert!(config_is_keyed(&make_config(
AggregationType::CountMinSketchWithHeap,
""
)));
assert!(config_is_keyed(&make_config(
AggregationType::CountSketch,
""
)));
assert!(config_is_keyed(&make_config(
AggregationType::CountSketchWithHeap,
""
)));
assert!(config_is_keyed(&make_config(AggregationType::HydraKLL, "")));

// Verify agreement with updater.is_keyed()
Expand Down