HLL

functionsupportedCore SQL functions

docs.snowflake.com ↗

Aggregate functionsWindow functions

Uses HyperLogLog to return an approximation of the distinct cardinality of the input (i.e. HLL(col1, col2, ... ) returns an approximation of COUNT(DISTINCT col1, col2, ... )). For more information about HyperLogLog, see Estimating the Number of Distinct Values.

Syntax

supportedpartialnot supportednot scored

Aggregate function

HLL( [ DISTINCT ] <expr1> [ , ... ] )

HLL(*)

Window function

HLL( [ DISTINCT ] <expr1> [ , ... ] ) OVER ( [ PARTITION BY <expr2> ] )

HLL(*) OVER ( [ PARTITION BY <expr2> ] )

Parameters

NameRequiredDescription
expr1requiredThis is the expression for which you want to know the number of distinct values.
expr2requiredThis is the optional expression used to group rows into partitions.

Returns

The data type of the returned value is INTEGER.

Usage notes

See also

Referenced by