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

feat: implement listagg macro #290

Merged
merged 3 commits into from
Jun 25, 2024
Merged

Conversation

igorvoltaic
Copy link
Contributor

Summary

Implement listagg macro, which is not supported at the moment

@CLAassistant
Copy link

CLAassistant commented Jun 6, 2024

CLA assistant check
All committers have signed the CLA.

{% set arr = "array_agg({})".format(measure) %}
{% set arr = "arraySort({}, {})".format(arr, order_by_clause) if order_by_clause else arr %}
{% if limit_num -%}
arrayStringConcat('{{delimiter_text}}', arraySlice({{ arr }}, 1, {{ limit_num }}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on the docs it seems that you need to pass the column name/array first, and only then the delimiter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, thanks a lot!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on docs singlequote also not needed. fixed that too

@BentsiLeviav BentsiLeviav mentioned this pull request Jun 25, 2024
@BentsiLeviav
Copy link
Contributor

I created a different task (#301) for adjusting the tests to assert the results.

@BentsiLeviav BentsiLeviav merged commit 03d7a18 into ClickHouse:main Jun 25, 2024
21 checks passed
BentsiLeviav added a commit to BentsiLeviav/docs.getdbt.com that referenced this pull request Aug 7, 2024
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.

3 participants