Reputation: 107
I have two records in schema tags
,
CREATE TABLE default.tags
(
`tag_id` String,
`count` SimpleAggregateFunction(sum, Int64),
`users` AggregateFunction(uniq, String),
`sessions` AggregateFunction(uniq, String)
)
And i want to merge all users into one record. I've tried uniqState(users)
but it gives me something with type AggregateFunction(uniq, AggregateFunction(uniq, String))
.
Upvotes: 0
Views: 2283
Reputation: 13300
you need to use uniqMerge function uniqMerge(users)
https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/combinators/#aggregate_functions_combinators-merge
https://kb.altinity.com/altinity-kb-queries-and-syntax/state-and-merge-combinators
Upvotes: 1