hash_agg_distinct

Description

Returns an aggregate signed 64-bit hash value over the (unordered) set of distinct input rows.

hash_agg_distinct() is not a cryptographic hash function and should not be used as such. hash_agg_distinct() accepts 1 or more input columns. hash_agg_distinct() never returns null, even if no input rows are provided. Empty input “hashes” to 0. Null is treated as a regular value that is not distinct from other null values, not an absent value.

Return type

int64

Domain

This is an aggregate function (aggregates rows over a group in aggregate verbs.)

This is a window function (calculates over a group of multiple input rows using windowing.)

Categories

Usage

hash_agg_distinct(expr_1, expr_2, ...)

Argument

Type

Optional

Repeatable

Restrictions

expr

storable

no

yes

none

Examples

statsby oa:hash_agg_distinct(jobid, status)

Return a single int64 hash of all distinct pairs of jobid, status values.

statsby oa:hash_agg_distinct(jobid), group_by(status)

Return an int64 hash of all distinct values of jobid, grouped by status.