Repository navigation
Ensure DISTINCT aggregates share branch only with matching ORDER BY - #27852
Merged
Merged
Conversation
Non-argument ORDER BY expressions become deduplication keys of the shared distinct branch, so merging an ordered DISTINCT aggregate into a set changed which rows the other members treated as duplicates. Two aggregates now only share a DistinctAggregateSet when their non-argument ORDER BY expressions match. Fixes duckdb#27815
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
duckdb-draftbot
marked this pull request as draft
October 25, 2026 16:43
KassaSana
marked this pull request as ready for review
October 27, 2026 21:27
lnkuiper
enabled auto-merge
November 2, 2026 14:21
PeterVanHolland
pushed a commit
to PeterVanHolland/duckdb
that referenced
this pull request
Nov 4, 2026
…uckdb#27852) Non-argument ORDER BY expressions become deduplication keys of the shared distinct branch, so merging an ordered DISTINCT aggregate into a set changed which rows the other members treated as duplicates. Two aggregates now only share a DistinctAggregateSet when their non-argument ORDER BY expressions match. Fixes duckdb#27815 Co-authored-by: KassaSana03 <[email protected]>
PeterVanHolland
pushed a commit
to PeterVanHolland/duckdb
that referenced
this pull request
Nov 4, 2026
## Summary Backports the PRs labeled `backport v2.0-cyanoptera` that are merged into `main` and not yet on this branch (oldest-first), as one squash commit per PR with the original author (`Co-authored-by` for further authors): duckdb#27958, duckdb#27869, duckdb#28043, duckdb#28065, duckdb#28066, duckdb#27690, duckdb#28046, duckdb#28042, duckdb#28074, duckdb#28056, duckdb#28037, duckdb#28073, duckdb#28005, duckdb#28016, duckdb#28076, duckdb#28104, duckdb#28108, duckdb#28087, duckdb#28097, duckdb#27767, duckdb#27998, duckdb#28029, duckdb#28121, duckdb#28119, duckdb#28120, duckdb#28109, duckdb#28117, duckdb#27916, duckdb#28118, duckdb#27860, duckdb#28114, duckdb#27923, duckdb#27804, duckdb#28098, duckdb#27915, duckdb#27930, duckdb#28213, duckdb#28217, duckdb#28210, duckdb#28134, duckdb#28222, duckdb#28231, duckdb#28232, duckdb#28235, duckdb#28239, duckdb#28241, duckdb#28019, duckdb#28199, duckdb#28230, duckdb#28188, duckdb#28246, duckdb#28245, duckdb#28228, duckdb#28251, duckdb#27852, duckdb#28223, duckdb#28252, duckdb#28258, duckdb#28253, duckdb#28180, duckdb#27779. ## Not included These depend on changes that are not on this branch: - duckdb#27943: needs 321ded7 (constant and dictionary vectors in `ColumnDataCollection`). - duckdb#27999: needs index-key collation, TRY-subquery binder state and update-segment changes. - duckdb#27326: needs 32cb90d (Parquet Thrift metadata arena). - duckdb#28225: needs the TRY lowering (`ExpressionType::OPERATOR_HAS_ERROR`). - duckdb#27849: the regenerated parser trampolines did not build on this branch. ## Notes - duckdb#28119 and duckdb#28120 report the same merge commit in the GitHub API, duckdb#28120 is picked from its own commit. - Dropped test hunks and files that belong to features not on this branch (duckdb#28029, duckdb#27998, duckdb#28076, duckdb#28188, duckdb#28056, duckdb#27767, duckdb#27804). - Built `reldebug` and ran all added or changed `.test` files: all pass. The full suite was not run. - Release-only change, not a backport: `round` in `extension/core_functions/scalar/math/numeric.cpp` now rounds half away from zero without calling the platform `round` (MinGW rounds `0.49999999999999994` to `1`). `main` still uses `std::round`; the same fix is open in duckdb#28306 and duckdb#28307, so it should be backported once one of them merges. - Release-only change, not a backport: the 256 MB and 512 MB `SELECT 42` cases in `tools/shell/tests/test_address_space_limit.py` are skipped because they segfault on v2.0-cyanoptera after running out of address space at startup. Whether the fix in duckdb#28310 can be backported to re-enable them is still to be checked.
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.
Non-argument ORDER BY expressions become deduplication keys of the shared distinct branch, so merging an ordered DISTINCT aggregate into a set changed which rows the other members treated as duplicates. Two aggregates now only share a DistinctAggregateSet when their non-argument ORDER BY expressions match.
Fixes #27815