strings_to_primitive_function

Function strings_to_primitive_function 

Source
pub(crate) fn strings_to_primitive_function<O, F, F2>(
    args: &[ColumnarValue],
    op: F,
    op2: F2,
    name: &str,
) -> Result<PrimitiveArray<O>>
where O: ArrowPrimitiveType, F: Fn(&str, &str) -> Result<O::Native>, F2: Fn(O::Native) -> O::Native,
Expand description

given a function op that maps &str, &str to the first successful Result of an arrow native type, returns a PrimitiveArray after the application of the function to args and the subsequence application of the op2 function to any successful result. This function calls the op function with the first and second argument and if not successful continues with first and third, first and fourth, etc until the result was successful or no more arguments are present.

ยงErrors

This function errors iff:

  • the number of arguments is not > 1 or
  • the function op errors for all input