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