Repository navigation
feat(query): add ordinary avg with window-compatible value handling - #791
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Ordinary
(avg ?v)currently fails with PRS-027. This adds it to v3's shared accumulator and engine path:10, "unknown", 20, nilaverages to15.0, matching window avg by skipping nonnumeric values and counting only numbers. Existing groups with no numbers return nil; queries with no matching bindings retain the existing no-row behavior.The implementation reuses window avg's exact summation and mean conversion, including NaN/infinity, overflow and signed-zero behavior. Retained exact-sum heap state for ordinary sum/avg is charged to the query memory limit before allocation and released on finish/error/rewind/close. Other aggregate value semantics and ordered optimization remain unchanged.
Repository docs and grammar fixtures are synchronized. Current tracker references use the v3.0.0 milestone after #383's retirement. This is the v3 portion of #777; v2 docs are #790 and the docs-site companion is project-minigraf/minigraf-docs#86. Keep #777 open until all scopes land. Other aggregate consistency work is #789. For #781: avg is infallible over decoded values, skips nonnumbers, and retains metered exact-sum state; ordered eli 8000 gibility still needs its own proof.
Validation:
No v2 runtime, public API, dependencies or file-format changes. No merge requested.