v.23.4New Feature
Support for quantileGK and quantilesGK Aggregate Functions with Greenwald-Khanna Algorithm
Support new aggregate functionquantileGK/quantilesGK, like approx_percentile in spark. Greenwald-Khanna algorithm refer to http://infolab.stanford.edu/~datar/courses/cs361a/papers/quantiles.pdf. #46428 (李扬).
Why it matters
These functions provide efficient and memory-friendly approximate quantile calculations similar to Spark'sapprox_percentile. They solve the problem of exact quantile computation being resource-intensive on large datasets by offering a reliable approximation with theoretical guarantees, thus improving performance and scalability.How to use it
Use the new aggregate functionsquantileGK or quantilesGK in your SELECT queries to calculate approximate quantiles. For example:SELECT quantileGK(0.5)(column_name) FROM table_name;These functions can be applied similarly to other aggregate functions in your queries without additional configuration.