Re: Javascript Based UDFs

2022-06-27 Thread Sean Owen
I don't know how these frameworks work, but I'd hope that it takes JavaScript and gives you some invokeable object. It's just Java executing like anything else, nothing special, no special consideration for being in a task? Why would it need another JVM? On Mon, Jun 27, 2022, 11:18 PM Matt Hawes

Re: Javascript Based UDFs

2022-06-27 Thread Matt Hawes
Thanks for the reply! I had originally thought that this would incur a cost of spinning up a VM every time the UDF is called but thinking about it again you might be right. I guess if I make the VM accessible via a transient property on the UDF class then it would only be initialized once per

Re: Javascript Based UDFs

2022-06-27 Thread Sean Owen
Rather than reimplement a new UDF, why not indeed just use an embedded interpreter? if something can turn javascript into something executable you can wrap that in a normal Java/Scala UDF and go. On Mon, Jun 27, 2022 at 10:42 PM Matt Hawes wrote: > Hi all, I'm thinking about trying to implement

Javascript Based UDFs

2022-06-27 Thread Matt Hawes
Hi all, I'm thinking about trying to implement the ability to write spark UDFs using javascript. For the use case I have in mind, a lot of the code is already written in javascript and so it would be very convenient to be able to call this directly from spark. I wanted to post here first before