Problem
In SimpleEngine::execute_and_merge_store_queries (asap-query-engine/src/engines/simple_engine/mod.rs), the Sliding-window branch hardcodes:
const EXPECTED_BUCKETS_PER_KEY: usize = 1;
This is only used to phrase a warn! when the store returns a different bucket count per key — it doesn't gate merge behavior (all buckets are merged regardless, per #570). But the constant itself is wrong whenever a sliding-window query's requested range spans more than one window width, per #554.
Formula
expected_buckets_per_key = (Total Range - Window Size) / Window Slide + 1
Total Range = the query's requested range_ms (timestamps.end_timestamp - timestamps.start_timestamp), available in create_store_query_plan.
Window Size = aggregation_config_for_value.window_size_ms.
Window Slide = aggregation_config_for_value.slide_interval_ms.
Both are available on the same aggregation_config_for_value already read in create_store_query_plan. When Total Range == Window Size (today's only supported case), this reduces to 1, matching current behavior.
Related
Problem
In
SimpleEngine::execute_and_merge_store_queries(asap-query-engine/src/engines/simple_engine/mod.rs), the Sliding-window branch hardcodes:This is only used to phrase a
warn!when the store returns a different bucket count per key — it doesn't gate merge behavior (all buckets are merged regardless, per #570). But the constant itself is wrong whenever a sliding-window query's requested range spans more than one window width, per #554.Formula
Total Range= the query's requestedrange_ms(timestamps.end_timestamp - timestamps.start_timestamp), available increate_store_query_plan.Window Size=aggregation_config_for_value.window_size_ms.Window Slide=aggregation_config_for_value.slide_interval_ms.Both are available on the same
aggregation_config_for_valuealready read increate_store_query_plan. WhenTotal Range == Window Size(today's only supported case), this reduces to1, matching current behavior.Related
expected_buckets_per_keywould actually exceed 1.