Introduced in: v24.1.0
Computes multiple approximate quantiles of a sample with relative-error guarantees at different levels simultaneously.
This function is equivalent to quantileDD but allows computing multiple quantile levels in a single pass, which is more efficient than calling individual quantile functions.
Syntax
quantilesDD(relative_accuracy, level1, level2, ...)(expr)Arguments
expr— Expression over the column values resulting in numeric data types,DateorDateTime.(U)Int*orFloat*orDateorDateTime
Returned value
Array of approximate quantiles of the specified levels in the same order as the levels were specified. For Date and DateTime inputs the output format matches the input format. Array(Float64) or Array(Date) or Array(DateTime)
Examples
Computing multiple quantiles with a DDSketch
SELECT quantilesDD(0.01, 0.25, 0.5, 0.75)(number) FROM numbers(10)┌─quantilesDD(0.01, 0.25, 0.5, 0.75)(number)────────────────┐
│ [1.9936617014173448,4.0148353330285875,5.989510371172621] │
└───────────────────────────────────────────────────────────┘