findepi opened a new issue, #16515:
URL: https://github.com/apache/datafusion/issues/16515
### Describe the bug
When parsing an array_agg with Postgres dialect, one can specify ordering of
values within group.
The syntax is accepted but apparently takes no effect on the aggregation
being executed.
At the very least syntax should be rejected as unsupported (then this
becomes a missing feature), or be supported.
### To Reproduce
Here the expected values were created with `cargo test --test sqllogictests
-- aggregate.slt --complete`, showing the bug
```
statement ok
set datafusion.sql_parser.dialect = 'Postgres';
query ?
SELECT array_agg(a_varchar) within group (order by a_varchar)
FROM (VALUES ('a'), ('d'), ('c'), ('a')) t(a_varchar);
----
[a, d, c, a]
query ?
SELECT array_agg(DISTINCT a_varchar) within group (order by a_varchar)
FROM (VALUES ('a'), ('d'), ('c'), ('a')) t(a_varchar);
----
[d, a, c]
```
### Expected behavior
```
statement ok
set datafusion.sql_parser.dialect = 'Postgres';
query ?
SELECT array_agg(a_varchar) within group (order by a_varchar)
FROM (VALUES ('a'), ('d'), ('c'), ('a')) t(a_varchar);
----
[a, a, c, d]
query ?
SELECT array_agg(DISTINCT a_varchar) within group (order by a_varchar)
FROM (VALUES ('a'), ('d'), ('c'), ('a')) t(a_varchar);
----
[a, c, d]
```
### Additional context
_No response_
--
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]