Repository navigation
fix: support ordered GROUP_CONCAT arguments - #26204
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep-reviewed the latest head across binding/config encoding, per-aggregate ordering, DISTINCT selection, partial/remote serialization, H0 and grouped spill, fan-in merge, NULL placement, prepared reuse, and cancellation. Focused sort/aggexec/group tests passed under race. I also measured the multi-key spill heap comparator directly (0 B/op, 0 allocs/op), so it does not reintroduce per-comparison GC pressure. No blocker found.
Merge Queue Status
This pull request spent 1 hour 35 minutes 59 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #26204 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
Failing checks:
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #24359
What this PR does / why we need it:
GROUP_CONCATpreviously collected every aggregate'sORDER BYkeys into oneglobal sort below the aggregation node. Besides the reported multi-argument
index panic, one input order cannot satisfy multiple
GROUP_CONCATaggregateswith independent ordering requirements.
This change binds ordering metadata to each
GROUP_CONCAT, stores its orderingexpressions as hidden aggregate arguments, and sorts each group inside the
aggregate executor through the shared multi-vector sorting implementation.
It also preserves explicit null placement, makes ordered
DISTINCTsort beforededuplication, and keeps legacy separator-only configuration compatible.
The ordered payload is covered across merge and intermediate serialization
paths. The return type continues to depend only on concatenated arguments, not
on hidden ordering-key types.
Validation:
pkg/sort,pkg/sql/colexec/order,pkg/sql/colexec/aggexec,pkg/sql/colexec/group, andpkg/sql/plango buildandgo vetfor affected packages andpkg/sql/compilemake buildmo-testerBVT: 158/158 statements passed