Skip to content

SQL: capability-matching rejects every grouped COUNT/SUM aggregation the planner actually builds #529

Description

@milindsrivastava1997

Scope: streaming_engine=precompute, SQL.

For CountMinSketch, the planner routes GROUP BY columns into aggregated_labels and leaves grouping_labels empty (asap-planner-rs/src/planner/labels.rs:15-21, set_subpopulation_labels).

The engine's capability-matching requirement builder always populates grouping_labels from the literal SQL GROUP BY columns (asap-query-engine/src/engines/simple_engine/sql.rs:318-322, build_query_requirements_sql), and labels_compatible (asap_types/src/capability_matching.rs:82-84) requires an exact match between config.grouping_labels and requirements.grouping_labels.

Result: a real planner-shaped CountMinSketch config (grouping_labels=[], aggregated_labels=[...]) never satisfies a capability-matching request for the same query, even though it's exactly the right aggregation.

Repro: built a SimpleEngine with a planner-shaped CountMinSketch(sub_type="count") config and no query_configs; SELECT COUNT(cpu_usage) FROM t WHERE time BETWEEN ... GROUP BY datacenterNone. Confirmed at the find_compatible_aggregation unit level too.

Related: #386 (same label-routing mismatch, previously fixed only for spatial MinMax; this shows it still exists for CountMinSketch).

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