Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 2.03 KB

hll-merge-function.md

File metadata and controls

57 lines (39 loc) · 2.03 KB
title description ms.reviewer ms.topic ms.date
hll_merge()
Learn how to use the hll_merge() function toe merge HLL results.
alexans
reference
12/28/2022

hll_merge()

Merges HLL results. This is the scalar version of the aggregate version hll_merge().

Read about the underlying algorithm (HyperLogLog) and estimation accuracy.

Important

The results of hll(), hll_if(), and hll_merge() can be stored and later retrieved. For example, you may want to create a daily unique users summary, which can then be used to calculate weekly counts. However, the precise binary representation of these results may change over time. There's no guarantee that these functions will produce identical results for identical inputs, and therefore we don't advise relying on them.

Syntax

hll_merge( hll, hll2, [ hll3, ... ])

[!INCLUDE syntax-conventions-note]

Parameters

Name Type Required Description
hll, hll2, ... string ✔️ The column names containing HLL values to merge. The function expects between 2-64 arguments.

Returns

Returns one HLL value. The value is the result of merging the columns hll, hll2, ... hllN.

Examples

This example shows the value of the merged columns.

[!div class="nextstepaction"] Run the query

range x from 1 to 10 step 1 
| extend y = x + 10
| summarize hll_x = hll(x), hll_y = hll(y)
| project merged = hll_merge(hll_x, hll_y)
| project dcount_hll(merged)

Output

dcount_hll_merged
20

Estimation accuracy

[!INCLUDE data-explorer-estimation-accuracy]