Skip to main content

HLL_UNION_AGG

Description​

The HLL_UNION_AGG function is an aggregate function, which is mainly used to merge multiple HyperLogLog data structures and estimate the approximate value of the combined cardinality.

Syntax​

hll_union_agg(<hll>)

Parameters​

ParametersDescription
<hll>The HyperLogLog type expression to be calculated

Return Value​

Returns the cardinality value of type BIGINT.

Example​

select HLL_UNION_AGG(uv_set) from test_uv;
+-------------------------+
| HLL_UNION_AGG(`uv_set`) |
+-------------------------+
| 17721 |
+-------------------------+