---
updatedAt: 2025-12-05T18:41:41.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# hash_agg_distinct

```
hash_agg_distinct([expr: storable]+) -> int64
```

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.

# Domain

This is an aggregate function (aggregates rows over a group in [aggregate verbs](verb#aggregate-verbs)).

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

# Categories

* [Aggregate](function#aggregate-functions)
* [Window](function#window-functions)

# Examples

<OpalCodeBlock code={
`statsby oa:hash_agg_distinct(jobid, status)
`}/>

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

<OpalCodeBlock code={
`statsby oa:hash_agg_distinct(jobid), group_by(status)
`}/>

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