Repository navigation
Add groupConcat second argument overload - #72540
Merged
Merged
Conversation
Contributor
|
This is an automated comment for commit c231828 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
yariks5s
marked this pull request as draft
November 27, 2024 11:42
yariks5s
marked this pull request as ready for review
December 2, 2024 19:22
Contributor
|
Could you please clarify why we need this functionality? |
divanik
reviewed
Dec 4, 2024
divanik
reviewed
Dec 4, 2024
divanik
reviewed
Dec 4, 2024
divanik
reviewed
Dec 4, 2024
divanik
reviewed
Dec 4, 2024
divanik
reviewed
Dec 4, 2024
divanik
left a comment
Contributor
There was a problem hiding this comment.
Minor issues and clarifying questions
divanik
approved these changes
Dec 5, 2024
Member
Author
|
|
yariks5s
enabled auto-merge
December 5, 2024 18:52
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Dec 5, 2024
Contributor
|
Hi @yariks5s @divanik — while reviewing this PR I found the following:
Happy to discuss — close anything that's wrong or already addressed. |
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
`groupConcat` accepts two unrelated spellings of its delimiter: - the original parameter form `groupConcat(delim, limit)(col)`, where the optional `limit` caps how many rows feed into the concatenation; - the two-argument overload added in ClickHouse#72540: `groupConcat(col, delim)`, which goes through `setSecondArgumentAsParameter` in the analyzer to rewrite the call into the parameter form. That rewrite was building a brand-new `FunctionNode` and pushing only the delimiter into its parameter list, never copying the original `function->parameters`. So a query that mixes both spellings — e.g. `groupConcat(',', 2)(x, '/')` — silently dropped the `2` and returned every row instead of the requested two. Preserve the original parameters and let the second-argument delimiter override position 0 (the two-argument spelling is the more specific one and already documented to "override current parameter" on the test above this case). The non-mixed paths are unaffected: when `function->parameters` is empty the delimiter is just pushed as the sole parameter, matching the previous behaviour. The reference for the existing `grouP_CONcat(',', 2)(p_array, '/')` case in `03156_group_concat.sql` was encoding the bug — updated to the limit-respecting output. Added `04076_group_concat_second_arg_preserves_limit.sql` for additional delimiter/limit combinations. Reported in ClickHouse#104774 via ClickHouse#72540 (comment). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Allows to use a delimiter as a optional second argument for aggregate function
groupConcat.Documentation entry for user-facing changes
CI Settings (Only check the boxes if you know what you are doing):