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

Aggregate function datatypes are not supported #51

Closed
fenjas opened this issue Nov 26, 2020 · 3 comments
Closed

Aggregate function datatypes are not supported #51

fenjas opened this issue Nov 26, 2020 · 3 comments

Comments

@fenjas
Copy link

fenjas commented Nov 26, 2020

An exception is thrown when an AggregateFunction datatype is encountered.

image
image

Will support for this datatype be available in upcoming releases?

@fenjas
Copy link
Author

fenjas commented Nov 26, 2020

@DarkWanderer
Copy link
Owner

DarkWanderer commented Nov 26, 2020

Hi. AggregateFunction column does not make sense by itself - you can neither insert nor select data directly. It can only be handled with functions like ...State for insertion and ...Merge (e.g.: uniqState, uniqMerge) for selection. It's not possible to support it directly - you can't even get output for it from ClickHouse itself via JSON/TSV

To query AggregatedFunction-type column, you need to use a ...Merge function. In this case the correct way to select would be:
select <other fields>, argMaxMerge(device_group_name), argMaxMerge(transaction_country_alpha_2_code) from <table>

@DarkWanderer
Copy link
Owner

Solidified this in wiki for future reference

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