Repository navigation
fix(sql): finalize nested exact aggregate inputs - #379
Merged
Merged
Conversation
Selvomega
added a commit
that referenced
this pull request
Sep 26, 2026
Brings per-measure FILTER predicates (#466) plus the five main commits it is based on (#445, #455, #426, #460, #461). Conflicts resolved toward main: `ValueOperationAtIngestionTime`, `query_time_nested_sum`, and the unconditional `finalize_exact_accumulator` from #461 replace dev/dqc's older #379 shape; the #455 wording in the architecture docs stands; the moved `accuracy.rs` is dropped in favor of `accuracy/mod.rs`. Co-Authored-By: Claude Fable 5.1 <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.
Why
The nested SQL aggregate rule could pass an
ExactAggregateaccumulator state directly into a read-time outer aggregate. Strict execution-state validation then rejected ordinary nested sums and backend workload compilation.What
Finalize an exact accumulator child at the maintenance-to-read boundary before a nested read-time aggregate consumes it.
How
Residual materialization detects exact read-time operations and applies the existing
FinalizeExactAccumulatortransformation using the child expression's canonical plain output schema. The validator remains unchanged.Before this PR
sum(rate(...))and nested SQL sums could fail withexact operator consumes non-plain column.After this PR
The inner accumulator remains maintained state, its explicit finalize node produces readable rows, and the outer aggregate consumes the typed values.
Verification
cargo fmt --all -- --checkcargo test -p asap-integration-tests --test sql_to_post_asap— 11 passedcargo test -p asap-integration-tests --test promql_to_post_asap promql_sum_of_count_over_time_is_composed_by_default_search— passed