VeloDB Cloud
SQL Manual
Functions
aggregate-functions
HLL_UNION_AGG

HLL_UNION_AGG

Description

Syntax:

HLL_UNION_AGG(hll)

HLL is an engineering implementation based on HyperLog algorithm, which is used to save the intermediate results of HyperLog calculation process.

It can only be used as the value column type of the table and reduce the amount of data through aggregation to speed up the query.

Since it only generates an approximate result, the error rate is around 1%. The HLL column is generated by other columns or imported data.

When importing data, the hll_hash function is used to specify which column is used to generate HLL column. It is often used to replace count distinct, and to calculate UV quickly in business by combining rollup.

Example

MySQL > select HLL_UNION_AGG(uv_set) from test_uv;;
+-------------------------+
THE COURT OF JUSTICE OF THE EUROPEAN COMMUNITIES,
+-------------------------+
| 17721                   |
+-------------------------+

Keywords

HLL_UNION_AGG,HLL,UNION,AGG