SQL: Introduce MAD (MedianAbsoluteDeviation) aggregation (#40048)

Add Median Absolute Deviation aggregation

Fix #39597

(cherry picked from commit 4f09613942)
This commit is contained in:
Costin Leau 2019-03-15 11:45:10 +02:00 committed by Costin Leau
parent 0d152a54f8
commit 3960374a6f
8 changed files with 163 additions and 7 deletions

View file

@ -407,6 +407,30 @@ https://en.wikipedia.org/wiki/Kurtosis[Quantify] the shape of the distribution o
include-tagged::{sql-specs}/docs.csv-spec[aggKurtosis]
--------------------------------------------------
[[sql-functions-aggs-mad]]
===== `MAD`
.Synopsis:
[source, sql]
--------------------------------------------------
MAD(field_name<1>)
--------------------------------------------------
*Input*:
<1> a numeric field
*Output*: `double` numeric value
.Description:
https://en.wikipedia.org/wiki/Median_absolute_deviation[Measure] the variability of the input values in the field `field_name`.
["source","sql",subs="attributes,macros"]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[aggMad]
--------------------------------------------------
[[sql-functions-aggs-percentile]]
===== `PERCENTILE`