approx_quantile

The value at rank option q (0 to 1) from a KLL sketch (option k, default 200; seed, required; confidence, default 2): {estimate, lower, upper} of the argument's type, values from the column, error kind rank.

AggregateDeterministic

Flags

Flag Value
Kind aggregate
Nulls nulls are skipped
Deterministic yes
Order matters no
Decomposable yes, by a KLL sketch

Example

A pipeline from the language's tested corpus that uses approx_quantile, over the example tables.

Hint
from orders
aggregate {d = approx_count_distinct(customer, lg_k: 10), m = approx_quantile(amount, q: 5e-1, seed: 7, confidence: 3), top = approx_frequent(status, max_map_size: 16, rule: "no_false_negatives")} by:{rush}

In a plan:

JSON
{
  "args": [
    {
      "col": 2
    }
  ],
  "fn": "approx_quantile",
  "options": {
    "confidence": 3,
    "q": 0.5,
    "seed": 7
  }
}