fix groupconcat#24941
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? |
| return 0, nil | ||
| } | ||
|
|
||
| func compareGroupConcatOrderValue(left, right any) int { |
There was a problem hiding this comment.
I am very surprised we need such a function. This is generic order by clause and should reuse all the code from say, sort operator.
More: type is ALWAYS available, so we should NOT need a type switch.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Requesting changes for two semantic regressions in the new GROUP_CONCAT ... ORDER BY rewrite.
-
DISTINCT + ORDER BYcan keep the wrong representative row- In
concat2.go, DISTINCT dedup happens first viadistinctHash.fill(...)on only the concat arguments. - The ORDER BY payload is sorted later in
flushGroup(). - So for cases like
GROUP_CONCAT(DISTINCT x ORDER BY y), duplicatexvalues with differentyvalues now keep whichever row was seen first, not the one implied by the ORDER BY.
- In
-
Explicit
NULLS FIRST/NULLS LASTis droppedbindGroupConcatOrderBy()inhaving_binder.goonly records ASC/DESC intoorderFlags.- Execution then compares nils with the default behavior in
types.CompareValue, so explicit null placement is no longer preserved.
I think both need to be fixed or rejected explicitly before approval.
What type of PR is this?
Which issue(s) this PR fixes:
issue #24359
What this PR does / why we need it:
修改 group_concat 的order by 改写.