Conversation
Contributor
Author
|
Integration note: #477 moves |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Evaluates instant selection and range functions over left-open windows at the query time or on a subquery step grid. Conflicts with earlier stack changes resolved to the integration tree: - crates/asap-physical-operators/src/operators/mod.rs: a7ff3ae Merge remote-tracking branch 'origin/feat/physical-compile-promql-fallback' into integration/planner-for-backend Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts with earlier stack changes resolved to the integration tree: - crates/asap-physical-operators/src/physical_planner/promql_rows.rs: a7ff3ae Merge remote-tracking branch 'origin/feat/physical-compile-promql-fallback' into integration/planner-for-backend Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
force-pushed
the
feat/physical-compile-coverage
branch
from
September 30, 2026 18:27
05d0ecb to
f9d8a3a
Compare
zzylol
force-pushed
the
feat/physical-compile-promql-fallback
branch
from
September 30, 2026 18:27
a4d7e16 to
fd0bb0a
Compare
zzylol
added a commit
that referenced
this pull request
Sep 30, 2026
…, without and @ Each Fallback selector reads its own raw-series slot. Vector-vector arithmetic uses PromQL one-to-one matching with on/ignoring via new series_labels and series_binary operators; without grouping rewrites the series identity; @ <timestamp> fixes selector and subquery evaluation. Conflicts with earlier stack changes resolved to the integration tree: - crates/asap-physical-operators/src/operators/mod.rs: 9a13ae4 integrate: extend asap-types series identity with #486/#487 shapes - crates/asap-physical-operators/src/physical_planner/promql_rows.rs: 9a13ae4 integrate: extend asap-types series identity with #486/#487 shapes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
added a commit
that referenced
this pull request
Sep 30, 2026
#477 moved PromQL series-identity resolution into asap-types. The fallback shapes compiled by #486 and #487 (time shifts, subqueries, scalar bridges, and arithmetic between series) also need identity realization there. Taken from integration commit 9a13ae4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Stacked on #484.
Rebuilt into the linear stack on main. Conflict resolutions are recorded in the messages of: "feat(physical): add a PromQL per-series window operator"; "feat(physical): compile PromQL fallback subtrees from typed expressions".
Why
physical_planner::compileaccepted aFallback{QueryExpr}node only when the node itself was supplied as an input. ASAPQuery-backend therefore re-parses the PromQL text into its own operator list and maps each operator topromql_values::compile_*(coverage rows 1, 9, 11, 12). This PR is priority item 1 ofdocs/develop_docs/physical-compile-coverage.md.What
compilelowers a Fallback node from its typed expression. The deployment supplies the raw rows of its one selector atpromql_fallback::raw_series_input(node), with the schema frompromql_fallback::raw_series(expr). Supplying the node's own ID still means "whole result supplied", for example by an external exact engine. A Fallback that reads no selector, such asvector(1), needs no input.Operator::series_windowevaluates each series at the query time, or on a subquery step grid, over the left-open window(t - offset - range, t - offset]. It covers instant selection andrate/increase/delta/{sum,avg,min,max,count}_over_time, reusing the temporal kernels. Onlydeltais new.offsetbyaggregates (a global aggregate over no series returns an empty vector)sort,topk by/limitscalar(),vector(literal)f(sel[R:S])andf(g(sel[r])[R:S])subqueries, including subqueryoffset, capped at 100000 stepswith_series_identitynow accepts these shapes.offset/@were silently dropped. They are now kept as aTimeShiftaround the subquery.Before this PR
max_over_time(m[5m:1m])retained as a Fallback fails to compile:physical operation has no native binding. The same happens forrate(m[5m]),scalar(m)and similar queries.max_over_time(m[5m:1m] offset 1m)lowered to the same tree as the query without the offset.After this PR
Take the samples m{job="a"} = (50s: 1), (110s: 7), (170s: 3), (290s: 4). The Fallback compiles to
SeriesWindow(instant, 60s lookback, steps 60s..300s) → SeriesWindow(max, 5m). At 300s it returns{job="a"} 7. The step at 240s has no sample in its lookback, so it contributes nothing.Remaining
histogram_quantile: the IR emitsby ()and drops output labels.@modifiers.withoutgrouping.irate,changes, and other range functions.Validation
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings, andcargo test --workspace --no-fail-fastall pass.New
tests/promql_fallback.rscompares against hand-computed Prometheus results. Cases: counter resets and extrapolation, left-open boundaries, offsets, lookback and stale markers, NaN, empty inputs,scalar()on 0, 1, or 2 series, subquery grid alignment and offset, and the step cap and input contracts.Regression tests that fail before their fix: subquery offset retention in
promql_lowering.rs, andtopk bypartitioning.A separate reviewer agent that did not write the code reviewed the change. Fixed findings, each with a test:
topk bylost its partition.Documented rather than changed: output rows keep
__name__in the identity (the adapter applies metric-name rules), and the raw-row extent a subquery requires.🤖 Generated with Claude Code