Skip to content

Tracking: SQL query parsing and matching support #822

Open

Description

@milindsrivastava1997

Tracks SQL query shapes we want ASAPQuery to support, using the PromQL compliance suites as the reference set. Coverage is checked by the SQL query support runner (#823) (asap-query-engine/tests/sql_query_support.rs), which plans each query and builds the engine execution context without executing it. Its suites mirror promql-compliance/suites case-for-case.

Supported today

  • Single-layer SUM / COUNT / MIN / MAX / QUANTILE / COUNT(DISTINCT col) with GROUP BY, e.g. sum by (job) (sum_over_time(data[5m]))
  • Time range as BETWEEN or half-open >= ... <, relative (NOW()) or absolute
  • Global top-k by SUM or COUNT: ORDER BY <alias> DESC LIMIT k

Unsupported shapes

No SQL equivalent yet (not in the SQL suites)

  • Counter rate() / increase()
  • PromQL subqueries over time, e.g. max_over_time((sum(m))[10m:])
  • Bare selector (raw samples), e.g. user_service_cache_refresh_lag_seconds

Intentionally rejected

  • Closed <= upper time bound: only half-open [start, end) ranges match ClickHouse's scan
  • No time filter

Activity

  1. changed the title [-]Tracking: SQL query support[/-] [+]Tracking: SQL query parsing and matching support[/+] on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions