HLL_CARDINALITY calculates the cardinality of a HyperLogLog (HLL) type value. It is an approximate counting algorithm suitable for estimating the number of distinct elements in large datasets.
HLL_CARDINALITY(<hll>)
| Parameter | Description |
|---|---|
<hll> | The HLL type value representing the dataset whose cardinality needs to be estimated. |
Returns the estimated cardinality of the HLL type value, representing the number of distinct elements in the dataset.
select HLL_CARDINALITY(uv_set) from test_uv;
+---------------------------+ | hll_cardinality(`uv_set`) | +---------------------------+ | 3 | +---------------------------+