Skip to content

query-engine: set data_range_ms to scrape_interval for spatial-only queries (remove None semantics) #461

Description

@milindsrivastava1997

Problem

data_range_ms = None currently carries two meanings: "spatial-only query" and "any window is compatible." The planner (fixed in #421) now always sets data_range_ms = Some(scrape_interval_ms) for spatial-only queries, making None explicit at the source. The query engine still produces None for spatial-only queries, leaving the implicit fallback alive in two places.

Callsites to fix

asap-query-engine/src/engines/simple_engine/promql.rs:1047
Calls build_query_requirements_promql(...) and passes the result directly to find_compatible_aggregation. For OnlySpatial queries, data_range_ms is None. Needs scrape_interval_ms threaded in and applied as an override after the call (same pattern as the planner fix).

asap-query-engine/src/engines/simple_engine/sql.rs:301
Sets data_range_ms = None for QueryPatternType::OnlySpatial explicitly. Needs scrape_interval_ms available at that point and Some(scrape_interval_ms) instead of None.

asap-common/dependencies/rs/asap_types/src/capability_matching.rs:69
window_compatible returns true unconditionally for None. Once both query-engine callsites above are fixed and None is never passed, this branch and the Option<u64> parameter can be changed to u64.

End state

QueryRequirements::data_range_ms changes from Option<u64> to u64, and None has no meaning anywhere in the system.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions