Skip to content

[fix](doc) add GROUP_CONCAT ORDER BY examples to 2.1/3.x group-concat docs#3744

Merged
morningman merged 1 commit into
apache:masterfrom
boluor:fix-group-concat-orderby-3487
May 23, 2026
Merged

[fix](doc) add GROUP_CONCAT ORDER BY examples to 2.1/3.x group-concat docs#3744
morningman merged 1 commit into
apache:masterfrom
boluor:fix-group-concat-orderby-3487

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 23, 2026

Summary

The GROUP_CONCAT page syntax already advertises [ORDER BY {<col_name>|<expr>} [ASC|DESC]], but the Examples section on 2.1/3.x only showed the basic and DISTINCT forms, so a reader couldn't see how ORDER BY actually attaches inside GROUP_CONCAT. The current/4.x pages already carry two ORDER BY examples — backport them to 2.1/3.x (EN + zh), with a version note on the DISTINCT + ORDER BY combination so users on older patch releases don't hit a parser error.

Added examples (matching the form already shipped in current/4.x):

select GROUP_CONCAT(value ORDER BY value DESC) from test;
-- => "c, c, b, a"

-- DISTINCT + ORDER BY is supported since 2.1.6 / 3.0.2 — see note above the example
select GROUP_CONCAT(DISTINCT value ORDER BY value DESC) from test;
-- => "c, b, a"

Version verification (from Doris source)

Test plan

  • All 4 backported files now have 6 GROUP_CONCAT(...) example calls, matching current/4.x.
  • DISTINCT + ORDER BY example is accompanied by a minimum-version note (2.1.6 for the 2.1 docs, 3.0.2 for the 3.x docs).
  • Dead-link check passes.
  • CI build.

Closes #3487

… docs

The syntax line already advertises `[ORDER BY {<col_name>|<expr>} [ASC|DESC]]`,
but the Examples section in 2.1/3.x only showed the basic and DISTINCT forms,
so users couldn't see how ORDER BY actually attaches inside GROUP_CONCAT.

Backport the two ORDER BY examples that current/4.x already carries:
- `GROUP_CONCAT(value ORDER BY value DESC)` -> "c, c, b, a"
- `GROUP_CONCAT(DISTINCT value ORDER BY value DESC)` -> "c, b, a"

Applied to EN + zh × {2.1, 3.x}.

Reported in apache#3487.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@boluor boluor force-pushed the fix-group-concat-orderby-3487 branch from dd8b341 to 985ef72 Compare May 23, 2026 02:13
@boluor boluor mentioned this pull request May 23, 2026
@morningman morningman merged commit b623e19 into apache:master May 23, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue on docs

2 participants