pub mod regexplike;
pub mod regexpmatch;
pub mod regexpreplace;
make_udf_function!(regexpmatch::RegexpMatchFunc, REGEXP_MATCH, regexp_match);
make_udf_function!(regexplike::RegexpLikeFunc, REGEXP_LIKE, regexp_like);
make_udf_function!(
regexpreplace::RegexpReplaceFunc,
REGEXP_REPLACE,
regexp_replace
);
pub mod expr_fn {
use datafusion_expr::Expr;
pub fn regexp_match(values: Expr, regex: Expr, flags: Option<Expr>) -> Expr {
let mut args = vec![values, regex];
if let Some(flags) = flags {
args.push(flags);
};
super::regexp_match().call(args)
}
pub fn regexp_like(values: Expr, regex: Expr, flags: Option<Expr>) -> Expr {
let mut args = vec![values, regex];
if let Some(flags) = flags {
args.push(flags);
};
super::regexp_like().call(args)
}
pub fn regexp_replace(
string: Expr,
pattern: Expr,
replacement: Expr,
flags: Option<Expr>,
) -> Expr {
let mut args = vec![string, pattern, replacement];
if let Some(flags) = flags {
args.push(flags);
};
super::regexp_replace().call(args)
}
}
#[doc = r" Return a list of all functions in this package"]
pub fn functions() -> Vec<std::sync::Arc<datafusion_expr::ScalarUDF>> {
vec![regexp_match(), regexp_like(), regexp_replace()]
}