use datafusion_expr::ScalarUDF;
use std::sync::Arc;
pub mod arrow_cast;
pub mod arrowtypeof;
pub mod coalesce;
pub mod getfield;
pub mod named_struct;
pub mod nullif;
pub mod nvl;
pub mod nvl2;
pub mod r#struct;
make_udf_function!(arrow_cast::ArrowCastFunc, ARROW_CAST, arrow_cast);
make_udf_function!(nullif::NullIfFunc, NULLIF, nullif);
make_udf_function!(nvl::NVLFunc, NVL, nvl);
make_udf_function!(nvl2::NVL2Func, NVL2, nvl2);
make_udf_function!(arrowtypeof::ArrowTypeOfFunc, ARROWTYPEOF, arrow_typeof);
make_udf_function!(r#struct::StructFunc, STRUCT, r#struct);
make_udf_function!(named_struct::NamedStructFunc, NAMED_STRUCT, named_struct);
make_udf_function!(getfield::GetFieldFunc, GET_FIELD, get_field);
make_udf_function!(coalesce::CoalesceFunc, COALESCE, coalesce);
pub mod expr_fn {
use datafusion_expr::Expr;
pub fn nullif(arg1: Expr, arg2: Expr) -> Expr {
super::nullif().call(vec![arg1, arg2])
}
pub fn arrow_cast(arg1: Expr, arg2: Expr) -> Expr {
super::arrow_cast().call(vec![arg1, arg2])
}
pub fn nvl(arg1: Expr, arg2: Expr) -> Expr {
super::nvl().call(vec![arg1, arg2])
}
pub fn nvl2(arg1: Expr, arg2: Expr, arg3: Expr) -> Expr {
super::nvl2().call(vec![arg1, arg2, arg3])
}
pub fn arrow_typeof(arg1: Expr) -> Expr {
super::arrow_typeof().call(vec![arg1])
}
pub fn r#struct(args: Vec<Expr>) -> Expr {
super::r#struct().call(args)
}
pub fn named_struct(args: Vec<Expr>) -> Expr {
super::named_struct().call(args)
}
pub fn get_field(arg1: Expr, arg2: Expr) -> Expr {
super::get_field().call(vec![arg1, arg2])
}
pub fn coalesce(args: Vec<Expr>) -> Expr {
super::coalesce().call(args)
}
}
pub fn functions() -> Vec<Arc<ScalarUDF>> {
vec![
nullif(),
arrow_cast(),
nvl(),
nvl2(),
arrow_typeof(),
r#struct(),
named_struct(),
get_field(),
coalesce(),
]
}