Hi,
I am using this setup:
1. target table
2. materialized view with engine type SummingMergeTree
And i am trying to define a uniqExactIf on the MV.
I tried using uniqExactIfState & uniqExactIfMerge but could not find how to define the AggregateFunction on the target table. AggregateFunction(uniqExactIf, UInt64) did not work.
So instead, i tried using:
uniqIf(session_uuid, struggle_severity='error') session_error_count_1,
uniqExactIf(session_uuid, struggle_severity='error') session_error_count_2,
count(distinct(session_uuid), struggle_severity='error') session_error_count_3
on the materialized view with:
session_error_count_1 Nullable(UInt64),
session_error_count_2 Nullable(UInt64),
session_error_count_3 Nullable(UInt64)
on the target table.
But when querying the MV with:
sum(session_error_count_1) as error_count_1,
sum(session_error_count_2) as error_count_2,
sum(session_error_count_3) as error_count_3
The numbers were a little different from what they should be.
Please advice.
thanks