datafusion_spark/function/string/
mod.rs1pub mod ascii;
19pub mod char;
20pub mod ilike;
21pub mod like;
22pub mod luhn_check;
23
24use datafusion_expr::ScalarUDF;
25use datafusion_functions::make_udf_function;
26use std::sync::Arc;
27
28make_udf_function!(ascii::SparkAscii, ascii);
29make_udf_function!(char::CharFunc, char);
30make_udf_function!(ilike::SparkILike, ilike);
31make_udf_function!(like::SparkLike, like);
32make_udf_function!(luhn_check::SparkLuhnCheck, luhn_check);
33
34pub mod expr_fn {
35 use datafusion_functions::export_functions;
36
37 export_functions!((
38 ascii,
39 "Returns the ASCII code point of the first character of string.",
40 arg1
41 ));
42 export_functions!((
43 char,
44 "Returns the ASCII character having the binary equivalent to col. If col is larger than 256 the result is equivalent to char(col % 256).",
45 arg1
46 ));
47 export_functions!((
48 ilike,
49 "Returns true if str matches pattern (case insensitive).",
50 str pattern
51 ));
52 export_functions!((
53 like,
54 "Returns true if str matches pattern (case sensitive).",
55 str pattern
56 ));
57 export_functions!((
58 luhn_check,
59 "Returns whether the input string of digits is valid according to the Luhn algorithm.",
60 arg1
61 ));
62}
63
64pub fn functions() -> Vec<Arc<ScalarUDF>> {
65 vec![ascii(), char(), ilike(), like(), luhn_check()]
66}