Repository navigation
SQLite, DuckDB: Support aggregate ORDER BY without arguments - #2660
Open
LucaCappelletti94 wants to merge 1 commit into
Open
LucaCappelletti94 wants to merge 1 commit into
LucaCappelletti94 wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2660 +/- ##
=======================================
Coverage 81.28% 81.29%
=======================================
Files 42 42
Lines 33920 33936 +16
Branches 33920 33936 +16
=======================================
+ Hits 27571 27587 +16
Misses 2785 2785
Partials 3564 3564 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
sqlite-aggregate-order-by-no-args
branch
from
October 18, 2026 14:15
77ce46a to
f168835
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.