Doris: GROUP_CONCAT(DISTINCT x, sep) is written back with an extra ',' argument
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start by tracing how SQLGlot parses and writes GROUP_CONCAT(DISTINCT x, '|') for the Doris dialect, then inspect nearby Doris dialect tests for GROUP_CONCAT cases. Add a regression case for the reported input and verify Doris output contains only the value and separator arguments; the issue's expected SQL provides the completion check.
Written by the indexing model from the issue text.
Description
The Doris dialect adds a third argument when it writes GROUP_CONCAT(DISTINCT x, sep) back:
import sqlglot
sqlglot.transpile("SELECT GROUP_CONCAT(DISTINCT x, '|') FROM t", read="doris", write="doris")
# ["SELECT GROUP_CONCAT(DISTINCT x, '|', ',') FROM t"]
Expected: SELECT GROUP_CONCAT(DISTINCT x, '|') FROM t.
Doris rejects the output: GROUP_CONCAT(DISTINCT x, '|', ',') fails with multi_distinct_group_concat requires one or two parameters. The input runs: SELECT GROUP_CONCAT(DISTINCT x, '|') FROM (SELECT 'a' AS x UNION ALL SELECT 'b' UNION ALL SELECT 'a') t returns a|b.
It looks like the separator is read as a second DISTINCT operand, and the default ',' separator is then appended.
Docs: https://doris.apache.org/docs/sql-manual/sql-functions/aggregate-functions/group-concat
Checked on main (c321d9f). I used an LLM (Claude) to help narrow this down and write it up; I checked the reproductions against SQLGlot and Doris myself.
- Dominant language
- Python
- Stars
- 9.8k
- Forks
- 1.5k
- Avg merge
- 10h 54m
- Merged PRs (30d)
- 310
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tobymao/sqlglot
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
ClickHouse: quantile is read as the exact Quantile, though ClickHouse's quantile is approximateOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
ClickHouse: DAY_OF_WEEK is read as DayOfWeek, so every call is written back as toDayOfWeek(t, 3)Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Oracle: qualify quotes USER, UID, ORA_ROWSCN and CONNECT_BY_ISLEAF/ISCYCLE as if they were columnsPossibly taken @georgesittas claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
tobymao/sqlglot#9468 · 1 comment ·
Maintainers usually reply within 1 day
-
INTERVAL '1 day ago' loses "ago" and becomes a positive intervalPossibly taken @treysp claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
daniel-ospina/tortoise#15014 ·
Maintainers usually reply within 1 day
-
area:api p2 product:business triage:active type:feat
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cuadrao-ai/argus#2656 ·
Maintainers usually reply within 1 day
-
documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
good first issue tests
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
yeab7505/tenasig#20 · 1 comment ·
Maintainers usually reply within 1 day