Skip to main content

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 achieve the purpose of speeding up the query.

Based on this, we get an estimate with an error of about 1%. The HLL column is generated by other columns or data imported into the data.

When importing, hll_hash function is used to specify which column in data 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