Skip to content

Fix optimizer incorrectly remove ORDER BY clause from aggregates - #19925

Merged
Mytherin merged 1 commit into
duckdb:v1.4-andiumfrom
tianjq16:bugfix_incorrectly_remove_order_from_aggregates
Nov 26, 2025
Merged

Mytherin merged 1 commit into
duckdb:v1.4-andiumfrom
tianjq16:bugfix_incorrectly_remove_order_from_aggregates

Conversation

@tianjq16

Copy link
Copy Markdown
Contributor

Fix #19924

When removing ORDER BY from aggregates, we need to check that the ORDER BY expression exists in each GroupingSet, not just whether it exists in the groups.

@pdet

pdet commented Nov 25, 2025

Copy link
Copy Markdown
Member

Hi @tianjq16, thanks for the PR, could you retag to v1.4, and fix the CI error?

@tianjq16
tianjq16 force-pushed the bugfix_incorrectly_remove_order_from_aggregates branch from c8e3ddb to 232010d Compare November 25, 2025 12:59
@tianjq16
tianjq16 changed the base branch from main to v1.4-andium November 25, 2025 12:59
@tianjq16

Copy link
Copy Markdown
Contributor Author

Hi @tianjq16, thanks for the PR, could you retag to v1.4, and fix the CI error?

Thanks for your reply! I have rebased this PR to the v1.4-andium branch and changed the target branch to v1.4-andium. Could you please trigger CI when you have time?

@pdet
pdet marked this pull request as draft November 25, 2025 15:12
@pdet
pdet marked this pull request as ready for review November 25, 2025 15:12
@pdet
pdet requested a review from taniabogatsch November 25, 2025 15:13
@pdet
pdet requested review from hawkfish and removed request for taniabogatsch November 25, 2025 15:23
@tianjq16
tianjq16 marked this pull request as draft November 26, 2025 03:37
@tianjq16
tianjq16 marked this pull request as ready for review November 26, 2025 03:37
@Mytherin
Mytherin merged commit f2512ab into duckdb:v1.4-andium Nov 26, 2025
199 of 200 checks passed
@Mytherin

Copy link
Copy Markdown
Collaborator

Thanks!

github-actions Bot pushed a commit to duckdb/duckdb-r that referenced this pull request Nov 27, 2025
Fix optimizer incorrectly remove ORDER BY clause from aggregates (duckdb/duckdb#19925)
No longer auto-enable profiling on DEBUG mode (duckdb/duckdb#19931)
github-actions Bot added a commit to duckdb/duckdb-r that referenced this pull request Nov 27, 2025
Fix optimizer incorrectly remove ORDER BY clause from aggregates (duckdb/duckdb#19925)
No longer auto-enable profiling on DEBUG mode (duckdb/duckdb#19931)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OrderedAggregateOptimizer may incorrectly remove the ORDER

4 participants