datafusion_expr::expr_fn

Function create_udf

Source
pub fn create_udf(
    name: &str,
    input_types: Vec<DataType>,
    return_type: DataType,
    volatility: Volatility,
    fun: ScalarFunctionImplementation,
) -> ScalarUDF
Expand description

Convenience method to create a new user defined scalar function (UDF) with a specific signature and specific return type.

Note this function does not expose all available features of ScalarUDF, such as

  • computing return types based on input types
  • multiple Signatures
  • aliases

See ScalarUDF for details and examples on how to use the full functionality.