distinct_count()
Estimate the number of distinct values from a hyperloglog
Since 1.3.0
Estimate the number of distinct values from a hyperloglog
Samples
Section titled “Samples”Estimate the number of distinct values from a hyperloglog named
hyperloglog. The expected output is 98,814.
SELECT distinct_count(hyperloglog(8192, data)) FROM generate_series(1, 100000) dataOutput:
distinct_count---------------- 98814Arguments
Section titled “Arguments”The syntax is:
distinct_count( hyperloglog Hyperloglog) RETURNS BIGINT| Name | Type | Default | Required | Description |
|---|---|---|---|---|
hyperloglog | Hyperloglog | - | ✔ | The hyperloglog to extract the count from. |
Returns
Section titled “Returns”| Column | Type | Description |
|---|---|---|
| distinct_count | BIGINT | The number of distinct elements counted by the hyperloglog. |