Handling Cancel Requests

You can cancel a query that calls your UDx (usually, by by pressing CTRL+C in vsql). How Vertica handles the cancelation of the query and your UDx depends on whether your UDx is running in fenced or unfenced mode:

See Fenced Mode for more information about running functions in fenced mode.

To give you more control over what happens to your function when the user cancels its query, the Vertica SDK includes an API for some UDxs to handle cancelation. Any function class that inherits from the Vertica::UDXObjectCancelable class can test whether the query calling it has been canceled using a function named isCanceled(). Your function can also implement a callback function named cancel() that Vertica calls when the function's query is canceled. Currently, the two classes that inherit from UDXObjectCancelable are TransformFunction and AnalyticFunction.

In This Section