distinct_count()

The distinct_count function gets the number of distinct values from a hyperloglog.

For more information about approximate count distinct functions, see the hyperfunctions documentation.

Required arguments

NameTypeDescription
hyperloglogHyperloglogThe hyperloglog to extract the count from.

Returns

ColumnTypeDescription
distinct_countBIGINTThe number of distinct elements counted by the hyperloglog.

Sample usage

This example retrieves the distinct values from a hyperloglog called hyperloglog:

SELECT distinct_count(hyperloglog(64, data))
FROM generate_series(1, 100) data

 distinct_count
----------------
            114

Found an issue on this page?

Report an issue!

Related Content