mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-16 04:32:33 +00:00
c23c7e0b6f
* feat: add DDSketch quantile * Fix StyleCheck * Move quantileddsketch.md under right dir * Update stateless test number and add stateful test * Throw exception when relative accuracy is too low * Update test number * Fix undefined behaviour for empty store * Fix quantileGK test * Update test numbers * Update src/AggregateFunctions/ * Throw exception on out of range values * Update relative accuracy docs and add encoding details * Address review comments and suggestions * Remove unused function * Address alexey review comments * Remove unused function isFloat64FieldType * Throw error on invalid relative accuracy * Simplify mapping * Address remaining review comments * Add effective memory usage suggestions * Fix Stylecheck * Fix fast test * Incorporate bins capacity suggestion * Fix fuzzer * Remove inheritance in Mapping, Store and DDSketch * Add checks for bin resizing * Add note about the binary compatible implementation
2.1 KiB
2.1 KiB
slug | sidebar_position |
---|---|
/en/sql-reference/aggregate-functions/reference/median | 212 |
median
The median*
functions are the aliases for the corresponding quantile*
functions. They calculate median of a numeric data sample.
Functions:
median
— Alias for quantile.medianDeterministic
— Alias for quantileDeterministic.medianExact
— Alias for quantileExact.medianExactWeighted
— Alias for quantileExactWeighted.medianTiming
— Alias for quantileTiming.medianTimingWeighted
— Alias for quantileTimingWeighted.medianTDigest
— Alias for quantileTDigest.medianTDigestWeighted
— Alias for quantileTDigestWeighted.medianBFloat16
— Alias for quantileBFloat16.medianDDSketch
— Alias for quantileDDSketch.
Example
Input table:
┌─val─┐
│ 1 │
│ 1 │
│ 2 │
│ 3 │
└─────┘
Query:
SELECT medianDeterministic(val, 1) FROM t;
Result:
┌─medianDeterministic(val, 1)─┐
│ 1.5 │
└─────────────────────────────┘