Share one query language contract - #576
Merged
Merged
Conversation
zzylol
force-pushed
the
refactor/unify-sds-catalog-contract
branch
from
September 10, 2026 16:00
a2ba424 to
445b60b
Compare
zzylol
force-pushed
the
refactor/unify-query-language
branch
from
September 10, 2026 16:00
6259d62 to
482321b
Compare
zzylol
force-pushed
the
refactor/unify-sds-catalog-contract
branch
from
September 10, 2026 16:08
445b60b to
0163b27
Compare
zzylol
force-pushed
the
refactor/unify-query-language
branch
from
September 10, 2026 16:09
482321b to
36e69c1
Compare
zzylol
force-pushed
the
refactor/unify-query-language
branch
from
September 10, 2026 16:31
36e69c1 to
ae61b84
Compare
zzylol
changed the base branch from
refactor/unify-sds-catalog-contract
to
main
September 10, 2026 16:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The backend defined three query-language enums: one in shared configuration, one in control-plane request types, and one in
QueryPlan. Their variant sets had already drifted, so adding MetricsQL or ClickHouse support required parallel edits and conversions.Before this PR
Legacy configuration recognized only a lowercase Rust
promqlvariant, control-plane request DTOs definedPromQL, and executable query plans separately definedPromQl,MetricsQl, andClickHouseSql.After this PR
asap_types::QueryLanguageis the single backend contract and is re-exported by request and query-plan modules. It covers PromQL, MetricsQL, and ClickHouse SQL with one stable snake-case serde representation. CLI aliases continue to acceptPROMQLandpromql. Legacy aggregation parsing now handles both time-series languages and derives explicit table/value-column inputs for ClickHouse SQL.Example
A
QueryPlanEntry, adapter configuration, and control-plane request now carry the sameQueryLanguage::MetricsQlvalue instead of crossing DTO-specific enum boundaries.Verification
cargo check --workspace --all-targetscargo test -p control_plane --lib query_plan::tests(5 passed)cargo test -p control_plane --lib types_v2::tests(6 passed)cargo test -p asap_types aggregation_config::tests(5 passed)git diff --checkDepends on #575.
ClickHouse migration surface: use
asap_types::QueryLanguage::ClickHouseSqlthrough the existingcontrol_plane::query_planre-export; do not add a language-specific enum or catalog.