LucaCappelletti94 opened a new pull request, #2660: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2660
SQLite and DuckDB accept an aggregate call whose only content is an `ORDER BY` clause, such as `SELECT count(ORDER BY a) FROM t`, but the parser failed with `Expected: ), found: BY`. SQLite documents `ORDER BY` inside 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 run `count(ORDER BY a)` and `count(ORDER BY a ASC, b DESC)` and both reject `count(DISTINCT ORDER BY a)`. SQLite also accepts `count(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. `DISTINCT` still requires an argument. Tests now cover every dialect on both sides of the capability. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
