Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support group_concat function #889

Open
jovezhong opened this issue Dec 29, 2024 · 1 comment
Open

Support group_concat function #889

jovezhong opened this issue Dec 29, 2024 · 1 comment
Assignees

Comments

@jovezhong
Copy link
Contributor

Reference https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/groupconcat

The use case is to follow the ClickHouse docs script to generate the markdown based on settings source code.

SELECT prefix || (SELECT groupConcat(*) FROM main_content)
INTO OUTFILE 'docs/en/operations/settings/settings.md' TRUNCATE FORMAT LineAsString

There is only 1 column in CTE main_content, so it uses groupConcat(*)

I can use group_array(col) to create an array but there is no function to turn this array of string to a single string. concat function takes multiple string params, but not an array.

@jovezhong
Copy link
Contributor Author

One workaround I found is array_fold(acc,x->concat(acc,x),group_array(str),''), but better to just use group_concat(str) when this is available.

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

No branches or pull requests

2 participants