ApproximateQuantiles
Takes a comparison function and the desired number of quantiles n, either globally or per-key. Using an approximation algorithm, it returns the minimum value, n-2 intermediate values, and the maximum value.
Examples
Example: to compute the quartiles of a PCollection of integers, we
would use ApproximateQuantiles.globally(5). This will produce a list
containing 5 values: the minimum value, Quartile 1 value, Quartile 2
value, Quartile 3 value, and the maximum value.
Related transforms
- ApproximateUnique estimates the number of distinct elements or distinct values in key-value pairs
- Combine
Last updated on 2025/10/27
Have you found everything you were looking for?
Was it all useful and clear? Is there anything that you would like to change? Let us know!


Javadoc