This message was deleted.
# general
s
This message was deleted.
m
I found a few possibilities @Fabrice Baranski including this. I haven't tried this solution so you'll have to do some experimentation:
Copy code
APPROX_COUNT_DISTINCT with HyperUnique:

Use the APPROX_COUNT_DISTINCT function with a hyperUnique aggregator during ingestion to estimate the number of distinct bit patterns in a column.

This approach is approximate but often sufficient for many use cases.
Copy code
SELECT APPROX_COUNT_DISTINCT(my_bit_column) FROM my_datasource;
f
Thanks @Mike Sherman. Can we use this kind of approximation (or datasketch, or theta) using window? we would like to have the distinct number of one column, cumulated over window.
For instance using HLL_SKETCH_UNION ower a window like this one :
Copy code
WINDOW w AS (
    ORDER BY metric DESC
    RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW  
)
m
You will have to experiment with this, Fabrice, and start by seeing if you can get the SQL parser to accept an approximation along with windowing.