hash_agg¶
Description¶
Returns an aggregate signed 64-bit hash value over the (unordered) set of input rows.
hash_agg() never returns NULL, even if no input is provided. Empty input “hashes” to 0. hash_agg() is not a cryptographic hash function and should not be used as such. hash_agg(NULL) returns an Int64 number. hash_agg(NULL, NULL) result is different from hash_agg(NULL). In this regard NULL can be seen as just a constant, not some special “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(expr_1, expr_2, ...)
Argument |
Type |
Optional |
Repeatable |
Restrictions |
---|---|---|---|---|
expr |
storable |
no |
yes |
none |
Examples¶
statsby oa:hash_agg(jobid, status)
Return an Int64 calculated based on all values in jobid and status columns.
statsby oa:hash_agg(jobid), group_by(status)
Return an Int64 calculated based on all values in jobid, grouped by status.