Skip to content

Commit

Permalink
Move kurtosis_pop to datafusion-functions-extra and out of core (#1…
Browse files Browse the repository at this point in the history
…2647)

Co-authored-by: Dharan Aditya <dharan.guthula@datapelago.com>
  • Loading branch information
dharanad and Dharan Aditya authored Sep 28, 2024
1 parent 689500f commit 322d835
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 269 deletions.
190 changes: 0 additions & 190 deletions datafusion/functions-aggregate/src/kurtosis_pop.rs

This file was deleted.

2 changes: 0 additions & 2 deletions datafusion/functions-aggregate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub mod average;
pub mod bit_and_or_xor;
pub mod bool_and_or;
pub mod grouping;
pub mod kurtosis_pop;
pub mod nth_value;
pub mod string_agg;

Expand Down Expand Up @@ -171,7 +170,6 @@ pub fn all_default_aggregate_functions() -> Vec<Arc<AggregateUDF>> {
average::avg_udaf(),
grouping::grouping_udaf(),
nth_value::nth_value_udaf(),
kurtosis_pop::kurtosis_pop_udaf(),
]
}

Expand Down
2 changes: 0 additions & 2 deletions datafusion/proto/tests/cases/roundtrip_logical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ use datafusion_functions_aggregate::expr_fn::{
approx_distinct, array_agg, avg, bit_and, bit_or, bit_xor, bool_and, bool_or, corr,
nth_value,
};
use datafusion_functions_aggregate::kurtosis_pop::kurtosis_pop;
use datafusion_functions_aggregate::string_agg::string_agg;
use datafusion_functions_window_common::field::WindowUDFFieldArgs;
use datafusion_proto::bytes::{
Expand Down Expand Up @@ -938,7 +937,6 @@ async fn roundtrip_expr_api() -> Result<()> {
vec![lit(10), lit(20), lit(30)],
),
row_number(),
kurtosis_pop(lit(1)),
nth_value(col("b"), 1, vec![]),
nth_value(
col("b"),
Expand Down
61 changes: 0 additions & 61 deletions datafusion/sqllogictest/test_files/aggregate.slt
Original file line number Diff line number Diff line change
Expand Up @@ -5862,64 +5862,3 @@ ORDER BY k;
----
1 1.8125 6.8007813 Float16 Float16
2 8.5 8.5 Float16 Float16

# The result is 0.19432323191699075 actually
query R
SELECT kurtosis_pop(col) FROM VALUES (1), (10), (100), (10), (1) as tab(col);
----
0.194323231917

# The result is -1.153061224489787 actually
query R
SELECT kurtosis_pop(col) FROM VALUES (1), (2), (3), (2), (1) as tab(col);
----
-1.15306122449

query R
SELECT kurtosis_pop(col) FROM VALUES (1.0), (10.0), (100.0), (10.0), (1.0) as tab(col);
----
0.194323231917

query R
SELECT kurtosis_pop(col) FROM VALUES ('1'), ('10'), ('100'), ('10'), ('1') as tab(col);
----
0.194323231917

query R
SELECT kurtosis_pop(col) FROM VALUES (1.0) as tab(col);
----
NULL

query R
SELECT kurtosis_pop(1)
----
NULL

query R
SELECT kurtosis_pop(1.0)
----
NULL

query R
SELECT kurtosis_pop(null)
----
NULL

statement ok
CREATE TABLE t1(c1 int);

query R
SELECT kurtosis_pop(c1) FROM t1;
----
NULL

statement ok
INSERT INTO t1 VALUES (1), (10), (100), (10), (1);

query R
SELECT kurtosis_pop(c1) FROM t1;
----
0.194323231917

statement ok
DROP TABLE t1;
14 changes: 0 additions & 14 deletions docs/source/user-guide/sql/aggregate_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ last_value(expression [ORDER BY expression])
- [regr_sxx](#regr_sxx)
- [regr_syy](#regr_syy)
- [regr_sxy](#regr_sxy)
- [kurtosis_pop](#kurtosis_pop)

### `corr`

Expand Down Expand Up @@ -528,19 +527,6 @@ regr_sxy(expression_y, expression_x)
- **expression_x**: Independent variable.
Can be a constant, column, or function, and any combination of arithmetic operators.

### `kurtosis_pop`

Computes the excess kurtosis (Fisher’s definition) without bias correction.

```
kurtois_pop(expression)
```

#### Arguments

- **expression**: Expression to operate on.
Can be a constant, column, or function, and any combination of arithmetic operators.

## Approximate

- [approx_distinct](#approx_distinct)
Expand Down

0 comments on commit 322d835

Please sign in to comment.