0

I have created a custom Scalar PrestoSQL/Trino UDF. I wanted to know if it is possible to detect and run a method at the end of UDF execution (end of execution of a task or after the last row/data of the split)? I want to run a cleanup/IPC resource deallocation after the UDF finishes execution on a split (kind of like a close() method)

FRG96
  • 151
  • 1
  • 9
  • UDF is executed on each worker. Do you allocate this resource per each UDF invocation on each worker? How about using event listener to be notified on such events like split finished? – kokosing Oct 02 '21 at 18:56
  • Yes. I use the UDF's constructor to create/initialize the resource. I missed reading about Event Listeners. I will try that out. If you have any links to blogs/docs other than the Trino official docs, it would be helpful. – FRG96 Oct 03 '21 at 05:04
  • https://trino.io/docs/current/develop/event-listener.html – kokosing Oct 04 '21 at 11:12

0 Answers0