Another UDF Error 100 debugging

I didn’t realize that the code must be on both server and client nodes because of the final reduce() , but now I understand where was the problem. Thanks for explanation!