max_val()
max_val(digest TDigest) RETURNS DOUBLE PRECISION
Get the maximum value from a t-digest (does not work with percentile_agg
or uddsketch
based estimators). This is provided in order to save space when both a maximum and a percentile estimate are required as part of continuous aggregates. You can simply compute a single percentile estimator and do not need to specify a separate max
aggregate, just extract the max_val
from the percentile estimator.
Required Arguments
Name | Type | Description |
---|---|---|
digest | TDigest | The digest to extract the max value from. |
Returns
Column | Type | Description |
---|---|---|
max_val | DOUBLE PRECISION | The maximum value entered into the t-digest. |
Sample Usage
SELECT max_val(tdigest(100, data))
FROM generate_series(1, 100) data;
max_val
---------
100
当前内容版权归 TimescaleDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 TimescaleDB .