num_vals()
Get the number of values contained in a `tdigest`
Since 1.0.0
Get the number of values contained in a tdigest aggregate. This accessor allows you to calculate a count alongside
percentiles, without needing to create two separate aggregates from the same raw data.
Samples
Section titled “Samples”Count the number of integers from 0 to 100.
SELECT num_vals(tdigest(data))FROM generate_series(0, 100) data;num_vals----------- 101Arguments
Section titled “Arguments”The syntax is:
num_vals( digest TDigest) RETURNS DOUBLE PRECISION| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| digest | TDigest | - | ✔ | The tdigest aggregate to extract the number of values from |
Returns
Section titled “Returns”| Column | Type | Description |
|---|---|---|
| num_vals | DOUBLE PRECISION | The number of values in the tdigest. |