Data structures
A quantile digest is a data sketch which stores approximate percentile information. The Trino type for this data structure is calledqdigest
,
and it takes a parameter which must be one of bigint
, double
or
real
which represent the set of numbers that may be ingested by the
qdigest
. They may be merged without losing precision, and for storage
and retrieval they may be cast to/from VARBINARY
.
Functions
merge
qdigest
s into a single qdigest
.
value_at_quantile
quantile
between 0 and 1.
quantile_at_value
quantile
number between 0 and 1 from the
quantile digest given an input value. Null is returned if the quantile digest
is empty or the input value is outside of the range of the quantile digest.
values_at_quantiles
qdigest_agg
qdigest
which is composed of all input values of x
.
qdigest
which is composed of all input values of x
using
the per-item weight w
.
qdigest
which is composed of all input values of x
using
the per-item weight w
and maximum error of accuracy
. accuracy
must be a value greater than zero and less than one, and it must be constant
for all input rows.