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

Lights Out

The LIGHTS_OUT Post-hook shuts down the warehouse after query completes.

If a user runs a query after normal working hours, and that query is the only one running on the warehouse, then shut the warehouse down after the query completes.

“Working hours” are defined using beginning and ending times (in 24-hour format HH:MM), plus a timezone, which apply Monday through Friday. Midnight on Friday through midnight on Sunday are automatically excluded from working hours.

Configuration Syntax

LIGHTS_OUT {
   'dayStart' : <workday-start-time>,
   'dayEnd'   : <workday-end-time>,
   'timeZone' : <timezone-string> 
}

Arguments

<workday-start-time>
String-formatted time (hours:minutes) when workday starts. 24-hour format.
<workday-end-time>
String-formatted time (hours:minutes) when workday ends. 24-hour format.
<timezone-string>
Timezone from the list of supported timezones, below.

List of supported timezones:

UTC
America/New_York
America/Chicago
America/Denver
America/Los_Angeles
Pacific/Honolulu
America/Phoenix
America/Indianapolis
America/Detroit
America/Toronto
America/Indiana/Indianapolis
America/Indiana/Knox
America/Indiana/Petersburg
America/Indiana/Tell_City
America/Indiana/Vevay
America/North_Dakota/Center
America/Sao_Paulo
Brazil/East
Canada/Eastern
Canada/Central
Europe/London
Europe/Paris
Europe/Berlin
Europe/Rome
Europe/Madrid
Europe/Warsaw
Europe/Athens
Europe/Prague
Europe/Amsterdam
Europe/Stockholm
Europe/Vienna
Europe/Dublin
Europe/Helsinki
Europe/Zurich
Asia/Tokyo
Asia/Hong_Kong
Asia/Singapore
Asia/Seoul
Asia/Shanghai
Asia/Taipei
Asia/Bangkok
Asia/Kolkata
Asia/Dubai
Asia/Jakarta
Asia/Kuala_Lumpur
Australia/Sydney

Examples

CREATE OR REPLACE SUNDECK FLOW "After-hours Shutdown after Last Query Completes"
  POST HOOK lights_out_hook
  ALWAYS
  LIGHTS_OUT {'dayStart': '9:00', 'dayEnd': '17:00', 'timeZone': 'UTC'}
  ENABLED = TRUE;