Function datafusion::prelude::create_udf

source ·
pub fn create_udf(
    name: &str,
    input_types: Vec<DataType, Global>,
    return_type: Arc<DataType>,
    volatility: Volatility,
    fun: Arc<dyn Fn(&[ColumnarValue]) -> Result<ColumnarValue, DataFusionError> + Send + Sync>
) -> ScalarUDF
Expand description

Creates a new UDF with a specific signature and specific return type. This is a helper function to create a new UDF. The function create_udf returns a subset of all possible ScalarFunction:

  • the UDF has a fixed return type
  • the UDF has a fixed signature (e.g. [f64, f64])