18
18
pub mod expm1;
19
19
pub mod factorial;
20
20
pub mod hex;
21
+ pub mod modulus;
21
22
pub mod rint;
22
23
23
24
use datafusion_expr:: ScalarUDF ;
@@ -27,6 +28,8 @@ use std::sync::Arc;
27
28
make_udf_function ! ( expm1:: SparkExpm1 , expm1) ;
28
29
make_udf_function ! ( factorial:: SparkFactorial , factorial) ;
29
30
make_udf_function ! ( hex:: SparkHex , hex) ;
31
+ make_udf_function ! ( modulus:: SparkMod , modulus) ;
32
+ make_udf_function ! ( modulus:: SparkPmod , pmod) ;
30
33
make_udf_function ! ( rint:: SparkRint , rint) ;
31
34
32
35
pub mod expr_fn {
@@ -39,9 +42,11 @@ pub mod expr_fn {
39
42
arg1
40
43
) ) ;
41
44
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) ) ;
42
47
export_functions ! ( ( rint, "Returns the double value that is closest in value to the argument and is equal to a mathematical integer." , arg1) ) ;
43
48
}
44
49
45
50
pub fn functions ( ) -> Vec < Arc < ScalarUDF > > {
46
- vec ! [ expm1( ) , factorial( ) , hex( ) , rint( ) ]
51
+ vec ! [ expm1( ) , factorial( ) , hex( ) , modulus ( ) , pmod ( ) , rint( ) ]
47
52
}
0 commit comments