HLL_CARDINALITY
Descriptionβ
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.
Syntaxβ
HLL_CARDINALITY(<hll>)
Parametersβ
Parameter | Description |
---|---|
<hll> | The HLL type value representing the dataset whose cardinality needs to be estimated. |
Return Valueβ
Returns the estimated cardinality of the HLL type value, representing the number of distinct elements in the dataset.
Exampleβ
select HLL_CARDINALITY(uv_set) from test_uv;
+---------------------------+
| hll_cardinality(`uv_set`) |
+---------------------------+
| 3 |
+---------------------------+