fix(aggregate): handle empty and singleton variance inputs - #1560
Merged
Merged
Conversation
Collaborator
|
Same ask as #1559, let's stack these and merge together! |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
dipeshbabu
force-pushed
the
fix/variance-small-inputs
branch
from
September 19, 2026 00:45
d88eea5 to
ad8b521
Compare
Contributor
Author
|
Rebased onto main after #1558 merged. This PR now contains only the variance fix. All 27 validation jobs pass. |
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.
Cross-shard variance/stddev queries fail when every shard returns NULL partial sums. Population variants also return NULL for a single finite value, while sample variants incorrectly return NaN for a singleton NaN.
Check the input count before inspecting partial sums, return NULL for insufficient sample inputs, and return zero for a finite singleton population before performing arithmetic.
Regression tests compare empty, all-NULL, singleton, and mixed-NULL inputs with PostgreSQL across integer, numeric, real, and double precision types.
Validation: all 27 jobs pass in CI, including strict formatting/Clippy, unit/doc tests, Linux/macOS builds, and all 21 integration suites on PostgreSQL 18.