Skip to content

materialized='table' causes brief service interruption (empty table window) #1269

@pandabrun

Description

@pandabrun

Describe the bug

When using the default table materialization in a dbt project on Databricks (Delta Lake), the process of replacing the table results in a brief, but critical, service interruption or "empty table" window for consumers.

This downtime occurs during the execution of the final SQL step, which is equivalent to a form of CREATE OR REPLACE TABLE AS SELECT ....

While Databricks/Delta Lake documentation suggests this operation is atomic and provides Snapshot Isolation (protecting long-running queries), we observe that new, short-lived queries (e.g., from dashboards, reports, or subsequent dbt models) that start immediately after the transaction commits can either:

  1. Fail due to the table being in a transient state.

  2. Return zero records, perceiving the table as momentarily empty before the new snapshot is fully available/indexed.

This behavior prevents true zero-downtime deployment for models that require a full refresh, which is a major constraint for production data pipelines.

Steps To Reproduce

In as much detail as possible, please provide steps to reproduce the issue. Sample data that triggers the issue, example model code, etc is all very helpful here.

Expected behavior

The table materialization should support a true zero-downtime swap, ensuring that consumers always have access to a consistent, non-empty snapshot of the data.

System information

dbt --version:*

[2025-11-17 00:59:31,575] INFO:root:00:59:31  Running with dbt=1.9.4
[2025-11-17 00:59:34,932] INFO:root:00:59:34  Registered adapter: databricks=1.10.2
[2025-11-17 00:59:35,093] INFO:root:00:59:35  Unable to do partial parsing because saved manifest not found. Starting full parse.

**The output of python --version:Python 3.11.11

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions