MetricSign
EN|NLRequest Access
Medium severitysql

Power BI Refresh Error:
QUERY_EXECUTION_TIMEOUT

What does this error mean?

A Databricks SQL query was canceled after exceeding the configured query timeout. This differs from a job-level TIMEDOUT — this error comes from the SQL execution engine and applies to individual queries within a job or SQL warehouse.

Common causes

  • 1A full table scan on a large Delta or Parquet table without partition pruning
  • 2A complex join between two large tables without proper partitioning or Z-ordering
  • 3A query timeout set too low for the actual query complexity
  • 4Cluster resources being shared between multiple concurrent queries
  • 5A new query plan chosen by the Spark optimizer that is less efficient than the previous one

How to fix it

  1. 1Run EXPLAIN on the query to understand the query plan and identify full table scans
  2. 2Add partition filters to reduce the amount of data scanned
  3. 3Use Z-ORDER BY on frequently filtered columns to improve data locality
  4. 4Check for missing OPTIMIZE runs on Delta tables — unoptimized tables produce too many small files
  5. 5Increase the query timeout if the query is genuinely complex and the timeout is too tight
  6. 6Scale up the cluster or SQL warehouse to provide more resources for the query

Frequently asked questions

Where is the query timeout configured in Databricks?

For SQL warehouses, set the query timeout in the SQL warehouse settings under 'Maximum query execution time'. For jobs running on clusters, the timeout is configured at the job or task level in the job settings.

Is QUERY_EXECUTION_TIMEOUT the same as a job TIMEDOUT?

No — QUERY_EXECUTION_TIMEOUT is a SQL-level error from the execution engine. Job TIMEDOUT is a job-level policy that kills the entire run regardless of what is executing.

Other sql errors