STATEMENT_TIMEOUT
Applies to: Databricks SQL
The STATEMENT_TIMEOUT
configuration parameter sets a timeout value in seconds. Any Databricks SQL statement with a wall clock run time exceeding the value is timed out.
You can set this parameter at the session level using the SET statement and at the global level using SQL configuration parameters or SQL Warehouses API.
Setting
Set a timeout value in seconds between 0 and 172800 seconds (2 days). Any Databricks SQL statement that has a wall clock execution time exceeding the set value is halted.
Examples
-- Set a session-level timeout
> SET STATEMENT_TIMEOUT = 86400;
> SELECT * FROM DIAMONDS;
-- Reset the timeout duration
> RESET STATEMENT_TIMEOUT;
> SELECT * FROM DIAMONDS;
To set a workspace-level timeout, go to the workspace admin settings and select SQL Configuration Parameters. Add a configuration parameter, where the timeout value is in seconds.
-- Set a workspace-level timeout
> STATEMENT_TIMEOUT 86400