UDF bulk implementation with some arguments as scalars