Databricks made the SQL statement timeout generally available on November 20, 2026. It stops any SQL statement that runs longer than a limit you choose.
You can set the limit at three levels: one session, one SQL warehouse, or the whole workspace. The session value wins over the warehouse value, and the warehouse value wins over the workspace value. The default is 172,800 seconds, which is two days.
I tested the session level on a Databricks Free Edition workspace.
The test
The query cross joins 30,000 by 100,000 generated rows, hashes each pair and returns one row. With no timeout it ran about 52 seconds on a serverless SQL warehouse.
SET STATEMENT_TIMEOUT = 30;
SELECT count(*) AS pairs,
sum(length(sha2(concat(a.id, b.id), 256))) AS checksum
FROM range(0, 30000) a CROSS JOIN range(0, 100000) b;
What happened
- It works as written. With 30 seconds, the query stopped at 30 seconds with
Statement has timed out after 30 seconds. - The newest value wins. In the same session I ran
SET STATEMENT_TIMEOUT = 120;and the same query finished in about 52 seconds with the same result. - It does not stay.
SET STATEMENT_TIMEOUT;returns the value in effect, 120 in that session. A new session returned the default, 172800.
What I could not test
The warehouse-level timeout is set with the statement_timeout field in the Update warehouse API. On Free Edition that call is rejected with Editing warehouse is not available to free users. Set up a paid account to access this feature. The docs say changing it restarts the warehouse, so plan for that. I also did not test the workspace level.
Screenshots
The timeout error after the 30 second run, and SET STATEMENT_TIMEOUT; returning 120 in the session where I had set it:
Reference
- STATEMENT_TIMEOUT, Microsoft Learn
- SQL warehouse sizing, scaling, and queuing behavior, Microsoft Learn
- November 2026 release notes, Microsoft Learn


Top comments (0)