Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion datafusion/spark/src/function/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
pub mod expm1;
pub mod factorial;
pub mod hex;
pub mod modulus;
pub mod rint;

use datafusion_expr::ScalarUDF;
Expand All @@ -27,6 +28,8 @@ use std::sync::Arc;
make_udf_function!(expm1::SparkExpm1, expm1);
make_udf_function!(factorial::SparkFactorial, factorial);
make_udf_function!(hex::SparkHex, hex);
make_udf_function!(modulus::SparkMod, modulus);
make_udf_function!(modulus::SparkPmod, pmod);
make_udf_function!(rint::SparkRint, rint);

pub mod expr_fn {
Expand All @@ -39,9 +42,11 @@ pub mod expr_fn {
arg1
));
export_functions!((hex, "Computes hex value of the given column.", arg1));
export_functions!((modulus, "Returns the remainder of division of the first argument by the second argument.", arg1 arg2));
export_functions!((pmod, "Returns the positive remainder of division of the first argument by the second argument.", arg1 arg2));
export_functions!((rint, "Returns the double value that is closest in value to the argument and is equal to a mathematical integer.", arg1));
}

pub fn functions() -> Vec<Arc<ScalarUDF>> {
vec![expm1(), factorial(), hex(), rint()]
vec![expm1(), factorial(), hex(), modulus(), pmod(), rint()]
}
Loading