1818pub mod expm1;
1919pub mod factorial;
2020pub mod hex;
21+ pub mod modulus;
2122pub mod rint;
2223
2324use datafusion_expr:: ScalarUDF ;
@@ -27,6 +28,8 @@ use std::sync::Arc;
2728make_udf_function ! ( expm1:: SparkExpm1 , expm1) ;
2829make_udf_function ! ( factorial:: SparkFactorial , factorial) ;
2930make_udf_function ! ( hex:: SparkHex , hex) ;
31+ make_udf_function ! ( modulus:: SparkMod , modulus) ;
32+ make_udf_function ! ( modulus:: SparkPmod , pmod) ;
3033make_udf_function ! ( rint:: SparkRint , rint) ;
3134
3235pub mod expr_fn {
@@ -39,9 +42,11 @@ pub mod expr_fn {
3942 arg1
4043 ) ) ;
4144 export_functions ! ( ( hex, "Computes hex value of the given column." , arg1) ) ;
45+ export_functions ! ( ( modulus, "Returns the remainder of division of the first argument by the second argument." , arg1 arg2) ) ;
46+ export_functions ! ( ( pmod, "Returns the positive remainder of division of the first argument by the second argument." , arg1 arg2) ) ;
4247 export_functions ! ( ( rint, "Returns the double value that is closest in value to the argument and is equal to a mathematical integer." , arg1) ) ;
4348}
4449
4550pub fn functions ( ) -> Vec < Arc < ScalarUDF > > {
46- vec ! [ expm1( ) , factorial( ) , hex( ) , rint( ) ]
51+ vec ! [ expm1( ) , factorial( ) , hex( ) , modulus ( ) , pmod ( ) , rint( ) ]
4752}
0 commit comments