Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
quantilesGK
Introduced in: v23.4.0 Computes multiple quantiles of a numeric data sequence at different levels simultaneously using the Greenwald-Khanna algorithm. This function works similarly withquantileGK but allows computing multiple quantile levels in a single pass, which is more efficient than calling individual quantile functions.
The Greenwald-Khanna algorithm is an algorithm used to compute quantiles on a stream of data in a highly efficient manner.
It was introduced by Michael Greenwald and Sanjeev Khanna in 2001.
The algorithm is highly efficient, taking only O(log n) space and O(log log n) time per item (where n is the size of the input).
It is also highly accurate, providing approximate quantile values with controllable accuracy.
Syntax
accuracy— Accuracy of quantiles. Constant positive integer. Larger accuracy value means less error. For example, if the accuracy argument is set to 100, the computed quantiles will have an error no greater than 1% with high probability. There is a trade-off between the accuracy of the computed quantiles and the computational complexity of the algorithm.UInt*level— Levels of quantiles. One or more constant floating-point numbers from 0 to 1.Float*
expr— Expression over the column values resulting in numeric data types, Date or DateTime.(U)Int*orFloat*orDecimal*orDateorDateTime
Array(Float64) or Array(Date) or Array(DateTime)
Examples
Computing multiple quantiles with GK algorithm
Query
Response
Query
Response