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
A Sum over a grouped PromQL sum fails to execute: the update reads a sample-value column the grouped output doesn't have #720
Pass 1 builds the plain candidate as three exact Sum accumulators: per series, then by job, then global. That candidate fails to execute:
summary update column missing or ambiguous
The outer global Sum's update reads the sample-value column from its input, but its input is the grouped sum's output [job, sum], which has no sample-value column. Expected: the outer Sum reads the grouped sum's measure column (sum) and returns the total.
Found while adding execution-equality tests for the reuse rules (PR #716). The nested-sum merge candidate from #716 doesn't hit this, because it reads the raw input rows directly.
Why it happens
When Pass 1 builds a SummaryAgg over the output of a grouped PromQL aggregate, it uses the sample-value lookup meant for raw series rows. It should resolve the update column against the child's actual output schema (the grouped aggregate's measure column).
Proposal
When the child is an aggregate, resolve the Sum (and the other accumulators') update column to the child's measure column, e.g. by using the schema the child's output_schema reports. Add a failing integration test first that executes every candidate of the query above and compares the rows.
Acceptance
All candidates of sum(sum by (job) (sum_over_time(m[5m]))) execute and return the same rows.
Activity