Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage


Hooks are used to modify queries before they are submitted to Snowflake, and can be fired before the query is submitted (Pre-hooks) or after the query runs (Post-hooks).

When a query arrives at the Sundeck Broker, it will progress a series of Hook evaluations. A Broker contains one or more Hooks or Routines (a Routine is a collection of Hooks). The query moves through the query evaluation phase, moving through each hook in order. At each hook, the hook condition is evaluated. If the hook condition evaluation returns TRUE, the hook is executed. This continues sequentially through all hooks until either all hooks/conditions are evaluated or a terminal hook is executed (such as REJECT). Each hook inspects and manipulates the output of the previously evaluated hook.

Sundeck features a robust set of system-defined Hooks as well as the ability for users to create their own custom hooks. The properties, conditions, or configuration of system-defined Hooks can be altered based on specific customer needs.

Currently offered built-in system Pre-hooks and built-in system Post-hooks

Defining hooks

Both Pre-hooks and Post-hooks are defined as part of the Broker or a Routine. See CREATE SUNDECK FLOW and ALTER SUNDECK FLOW.

Customizing built-in system Hook properties

Sundeck provides two ways to customize Hook properties: Sundeck SaaS User interface and SQL.

DDL for hooks

To modify the properties, conditions, or configuration of existing Hook in the Broker use ALTER SUNDECK FLOW

Sundeck UI

  1. Navigate to Broker > Config page.
  2. Modify hook’s properties: enable/disable, modifiy condition, etc.
  3. Click ‘Save’ for changes to take effect.

Using pre-defined variables in hooks

Sundeck provides predefined variables that can be used in hooks. See Hook Variables for more details.