| 1 | | Hi, I’ve started looking into this ticket. |
| 2 | | |
| 3 | | I can reproduce the issue on SQLite: using StringAgg(distinct=True) raises an exception, even though SQLite’s native GROUP_CONCAT supports DISTINCT in the form: |
| 4 | | |
| 5 | | GROUP_CONCAT(DISTINCT expr) |
| 6 | | |
| 7 | | This seems to be blocked because SQLite only allows DISTINCT when the aggregate has a single argument (i.e., DISTINCT cannot be used when a custom separator is passed). |
| 8 | | |
| 9 | | A possible fix would be to allow StringAgg(distinct=True) on SQLite when no explicit delimiter is provided, and add a regression test to cover the supported DISTINCT behavior. |
| 10 | | |
| 11 | | I’ll continue investigating the ORM aggregate SQL generation and will work on a patch + tests. |