Skip to content

Commit f319aa4

Browse files
convert sum aggregate function to UDF
1 parent 5da84b9 commit f319aa4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/functions.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ use datafusion_expr::{
3535
lit, Expr, WindowFunctionDefinition,
3636
};
3737

38+
#[pyfunction]
39+
pub fn sum(args: PyExpr) -> PyExpr {
40+
functions_aggregate::expr_fn::sum(args.expr).into()
41+
}
42+
3843
#[pyfunction]
3944
pub fn covar_samp(y: PyExpr, x: PyExpr) -> PyExpr {
4045
functions_aggregate::expr_fn::covar_samp(y.expr, x.expr).into()
@@ -644,7 +649,6 @@ aggregate_function!(grouping, Grouping);
644649
aggregate_function!(max, Max);
645650
aggregate_function!(mean, Avg);
646651
aggregate_function!(min, Min);
647-
aggregate_function!(sum, Sum);
648652
aggregate_function!(stddev, Stddev);
649653
aggregate_function!(stddev_pop, StddevPop);
650654
aggregate_function!(stddev_samp, Stddev);

0 commit comments

Comments
 (0)