Updated on 2024-12-13 GMT+08:00

T-Digest Functions

Overview

A T-digest is a data sketch that stores approximate percentile information. The HetuEngine type for this data structure is called tdigest. Tdigests may be merged without losing precision, and for storage and retrieval they may be cast to/from VARBINARY.

Function

  • merge(tdigest)→tdigest

    Description: Merges all input tdigests into a single tdigest.

  • value_at_quantile(tdigest,quantile)→double

    Description: Returns the approximate percentile values from the T-digest given the number quantile between 0 and 1.

  • values_at_quantiles(tdigest,quantiles)->array(double)

    Description: Returns the approximate percentile values as an array given the input T-digest and array of values between 0 and 1 which represent the quantiles to return.

  • tdigest_agg(x)->tdigest

    Description: Returns the tdigest which is composed of all input values of x. x can be of any numeric type.

  • tdigest_agg(x,w)->tdigest

    Description: Returns the tdigest which is composed of all input values of x using the per-item weight w. w must be no less than 1. x and w can be of any numeric type.