Repository navigation
SQLite, DuckDB: Support aggregate ORDER BY without arguments - #2660
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2660 +/- ##
=======================================
Coverage 81.83% 81.84%
=======================================
Files 42 42
Lines 34651 34667 +16
Branches 34651 34667 +16
=======================================
+ Hits 28357 28373 +16
Misses 2753 2753
Partials 3541 3541 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
sqlite-aggregate-order-by-no-args
branch
2 times, most recently
from
October 20, 2026 10:59
f168835 to
befbf87
Compare
alamb
approved these changes
Oct 20, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 20, 2026
LucaCappelletti94
force-pushed
the
sqlite-aggregate-order-by-no-args
branch
from
October 21, 2026 07:34
befbf87 to
a43767e
Compare
alamb
reviewed
Oct 22, 2026
| "SELECT count(*) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t", | ||
| ); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
I bet if you changed these PRs so they didn't all try and put the tests at the end of this file (put it after different other tsts) they wouldn't all conflict
Contributor
Author
There was a problem hiding this comment.
I tried to scramble them, and it seems to have made some but little difference.
LucaCappelletti94
force-pushed
the
sqlite-aggregate-order-by-no-args
branch
4 times, most recently
from
October 24, 2026 07:16
cd553ed to
89ca6b1
Compare
LucaCappelletti94
force-pushed
the
sqlite-aggregate-order-by-no-args
branch
from
October 24, 2026 07:52
89ca6b1 to
1612cae
Compare
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.
SQLite and DuckDB accept an aggregate call whose only content is an
ORDER BYclause, such asSELECT count(ORDER BY a) FROM t, but the parser failed withExpected: ), found: BY. SQLite documentsORDER BYinside aggregate calls (https://www.sqlite.org/lang_aggfunc.html#aggorderby) and so does DuckDB (https://duckdb.org/docs/current/sql/functions/aggregates#order-by-clause-in-aggregate-functions). SQLite 3.51.1 and DuckDB 1.4.4 both runcount(ORDER BY a)andcount(ORDER BY a ASC, b DESC)and both rejectcount(DISTINCT ORDER BY a). SQLite also acceptscount(ALL ORDER BY a).A new dialect method,
supports_aggregate_order_by_with_empty_args, enables the form for SQLite, DuckDB and the generic dialect.DISTINCTstill requires an argument. Tests now cover every dialect on both sides of the capability.