hll() (aggregation function)

Calculates the Intermediate results of dcount across the group, only in context of aggregation inside summarize.

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

Syntax

hll (Expr [, Accuracy])

Arguments

  • Expr: Expression that will be used for aggregation calculation.

  • Accuracy, if specified, controls the balance between speed and accuracy.

    Accuracy Value Accuracy Speed Error
    0 lowest fastest 1.6%
    1 default balanced 0.8%
    2 high slow 0.4%
    3 high slow 0.28%
    4 extra high slowest 0.2%

Returns

The Intermediate results of distinct count of Expr across the group.

Tips

  1. You may use the aggregation function hll_merge to merge more than one hll intermediate results (it works on hll output only).

  2. You may use the function dcount_hll, which will calculate the dcount from hll / hll_merge aggregation functions.

Examples

StormEvents
| summarize hll(DamageProperty) by bin(StartTime,10m)

StartTime hll_DamageProperty
2007-09-18 20:00:00.0000000 [[1024,14],[-5473486921211236216,-6230876016761372746,3953448761157777955,4246796580750024372],[]]
2007-09-20 21:50:00.0000000 [[1024,14],[4835649640695509390],[]]
2007-09-29 08:10:00.0000000 [[1024,14],[4246796580750024372],[]]
2007-12-30 16:00:00.0000000 [[1024,14],[4246796580750024372,-8936707700542868125],[]]