Two PromQL constructs parse cleanly but are rejected by the lowerer. Both are genuine coverage gaps rather than parser issues, so they are fixable entirely within crates/frontend-promql.
# histogram_quantiles — upstream experimental, variadic (up to 9 quantiles),
# returns one series per φ, tagged with the given label
histogram_quantiles(testhistogram3, "q", 0, 0.25, 0.5, 0.75, 1)
# non-literal k: the parameter is a scalar-valued *expression*, not a literal
topk(scalar(foo), http_requests)
Summary
Two PromQL constructs parse cleanly but are rejected by the lowerer. Both are genuine coverage gaps rather than parser issues, so they are fixable entirely within
crates/frontend-promql.Corpus impact
30 rejections on
origin/main@9fdd3d7(of 322 total), plus ~21 more in the "arguably correct" bucket described under Notes.histogram_quantiles(v, "label", φ…)UnsupportedFunctionk/φparameterInvalidParameterExamples
Notes
histogram_quantilesis a real upstream function (promql/parser/functions.go:213,Experimental: true,Variadic: 9). It is effectivelyhistogram_quantilefanned out over N quantiles with the results labelled — so it should decompose into the existingAggIntent::Quantilepath once the fan-out is expressed. Related but distinct from PromQL: native-histogram accessor functions (histogram_*) unsupported #43 (histogram accessors) and PromQL: histogram_quantile classic-bucket vs sketch-able quantile is a structural heuristic — drive it from sample type/metadata #79 (classic-bucket vs sketch-able quantile), neither of which covers it.krejection comes fromcrates/frontend-promql/src/promql.rs:1560(expected a numeric scalar, got {:?}). Todaytopk/bottomk/quantilerequire a literal scalar.topk(scalar(foo), v)supplies a scalar-valued subexpression, which is legal PromQL. Note the error message leaks a rawDiscriminant(9)rather than naming the offending node — worth fixing regardless.±Inf/NaNplus a warn annotation, whereas we hard-error:k+ 1 non-finitelimit_ratioratio = 21.)These originate from
promql.rs:1617. For an optimizer IR, rejecting may well be the right call — but the divergence from PromQL semantics should be a conscious choice and ideally a documented one.("Foo")), rejected asUnsupportedFeature("bare string literal"). String-typed expressions have no vector semantics; almost certainly WAI.