tdigest_quantile
tdigest_quantile(inputExpr: tdigest, quantile: const numeric) -> numeric or duration
Estimates the value at a requested probability from a tdigest column. The quantile argument must be a compile-time constant between 0 and 1 inclusive; otherwise compilation fails with an out-of-range error. The result type is the digest’s inner numeric type coerced to floating point for real-valued samples, with an extra cast back to duration when the digest was built from durations. For histogram-shaped digests accessed through the unified histogram API, histogram_quantile accepts the same quantile argument with identical range validation.
Domain
This is a scalar function (calculates a single output value for a single input row).
Categories
Examples
align 5m, frame(back: 5m), o: tdigest_quantile(m_tdigest("latency"), 0.95)
Produces an approximate 95th percentile from a digest metric selected during alignment for SLO monitoring.
make_col median_ms:tdigest_quantile(request_digest, 0.5)
Adds a column with the median request latency estimate derived from an existing digest field on each row.
Updated 19 days ago