On this page

    Categories: Aggregate, Window

    HLL

    Uses HyperLogLog to return an approximation of the distinct cardinality of the input.

    Syntax

    HLL(expression boolean) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    Examples

    SELECT HLL(TRUE)
    -- sample return
    

    HLL(expression float) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    Examples

    SELECT HLL(67.90)
    -- sample return
    

    HLL(expression varbinary) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    HLL(expression date) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    Examples

    SELECT HLL('2021-06-15')
    -- sample return
    

    HLL(expression interval_year) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    HLL(expression interval_day) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    HLL(expression int64) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    Examples

    SELECT HLL(2021)
    -- sample return
    

    HLL(expression double) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    Examples

    SELECT HLL(45.7)
    -- sample return
    

    HLL(expression time) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    HLL(expression int32) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    Examples

    SELECT HLL(2021)
    -- sample return 1
    

    HLL(expression varchar) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    Examples

    SELECT HLL('dremio')
    -- sample return 1
    

    HLL(expression timestamp) → varbinary

    • expression: Expression for which you want to know the number of distinct values.

    Examples

    SELECT HLL('2021-06-17 11:50:59')
    -- sample return 1