You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
e2e_plan cannot plan MetricsQL: UserInput::validate rejects every FrontendInput::Metricsql #534
UserInput::validate (crates/planner/src/lib.rs, ~L87-104) accepts only these language/frontend pairs:
QueryLanguage::SQL(_) or QueryLanguage::DataFusion with FrontendInput::Sql
QueryLanguage::PromQL with FrontendInput::Promql
QueryLanguage (crates/types/src/workload.rs, ~L42) has the variants PromQL, SQL(_), DataFusion and ElasticDSL. None of them is MetricsQL. So any UserInput with FrontendInput::Metricsql fails validation with UserInputError::FrontendMismatch, and the FrontendInput::Metricsql branch of e2e_plan (~L253, lower_metricsql) is unreachable.
Before
Planning a MetricsQL workload through e2e_plan always fails before lowering, with FrontendMismatch { language: "PromQL", frontend: "Metricsql" } (or with whatever language is set).
Expected
A workload whose language is MetricsQL is accepted with FrontendInput::Metricsql, then lowered and planned.
Options
Add QueryLanguage::MetricsQL (serde "metricsql") and accept it with FrontendInput::Metricsql. Recommended: the workload then states its language explicitly. It is an additive workload-format change, so check whether any deployment matches on QueryLanguage exhaustively.
Accept QueryLanguage::PromQL with FrontendInput::Metricsql. Smaller, but it records MetricsQL workloads as PromQL.
Test
An e2e_plan test that plans one MetricsQL query end to end. It fails on main with FrontendMismatch.
Found while documenting extension scenarios for #533.
Activity