mode
The most frequent non-null value; a tie takes the least.
Flags
| Flag | Value |
|---|---|
| Kind | aggregate |
| Nulls | nulls are skipped |
| Deterministic | yes |
| Order matters | no |
| Decomposable | yes, by value counts |
Example
A pipeline from the language's tested corpus that uses mode, over the example tables.
from orders
aggregate {med = median(amount), p90 = quantile(amount, q: 9e-1), p10 = quantile(price, q: 1e-1, method: "disc"), v = var_samp(price), sd = stddev_samp(price), m = mode(status), d = count_distinct(customer)} by:{rush}In a plan:
{
"args": [
{
"col": 7
}
],
"fn": "mode"
}