kurtosis aggregate function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Returns the kurtosis value calculated from values of a group.

Syntax

kurtosis ( [ALL | DISTINCT] expr ) [FILTER ( WHERE cond ) ]

Arguments

  • expr: An expression that evaluates to a numeric.
  • cond: An optional boolean expression filtering the rows used for aggregation.

Returns

A DOUBLE.

If DISTINCT is specified the function operates only on a unique set of expr values.

Examples

> SELECT kurtosis(col) FROM VALUES (-10), (-20), (100), (100), (1000) AS tab(col);
 0.16212458373485106
> SELECT kurtosis(DISTINCT col) FROM VALUES (-10), (-20), (100), (100), (1000) AS tab(col);
 -0.7014368047529627
> SELECT kurtosis(col) FROM VALUES (1), (10), (100), (10), (1) as tab(col);
 0.19432323191699075