Implementing the Cancel Callback Function

Your User-Defined Transform Function (UDTF) or Analytic Function (UDAnF) can implement a cancel() callback function that Vertica calls if the query that called the function has been canceled. You usually implement this function to perform an orderly shutdown of any additional processing that your UDx spawned. For example, you can have your cancel() function shut down threads that your UDx has spawned or signal a third-party library that it needs to stop processing and exit. Your cancel() function should leave your UDx's function class ready to be destroyed, since Vertica calls the UDx's destroy function after the cancel function has exited.

Notes