transpiler icon indicating copy to clipboard operation
transpiler copied to clipboard

Max and Min function on mvfield(s)

Open tombonfert opened this issue 4 years ago • 0 comments

  • Min(X,...) and Max(X,...) functions take an arbitrary number of arguments and return the minimum and maximum per row, respectively.
  • Currently, our implementation is good for single value fields in the input. We are calling Spark's 'least' and 'greatest' method.
  • Our implementation fails or produces wrong results for the following inputs:
    • The only input argument is a mvfield -> Need to call 'array_min' or 'array_max' instead of 'least' or 'greatest'.
    • There are several mvfields as input -> Create array of input arrays -> Flatten -> call array_min / array_max
    • In Splunk it is also possible to provide a mixture of mvfields and svfields in the input.
  • Solution: We need to know the data types of the input arguments.

tombonfert avatar Nov 17 '21 14:11 tombonfert