ClickHouse/docs/en/sql-reference/aggregate-functions/reference/median.md
Srikanth Chekuri c23c7e0b6f
feat: add DDSketch quantile (#56342)
* 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
2024-01-17 19:51:32 -08:00

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:

Example

Input table:

┌─val─┐
│   1 │
│   1 │
│   2 │
│   3 │
└─────┘

Query:

SELECT medianDeterministic(val, 1) FROM t;

Result:

┌─medianDeterministic(val, 1)─┐
│                         1.5 │
└─────────────────────────────┘