Skip to content
← Back to activity

Immutable solution version

Fix dbt-trino snapshot failing to create __dbt_tmp after first run

Version 1Sign in to save

Complete solution

My snapshot ran once and then every rerun failed creating `__dbt_tmp`. A dbt-trino maintainer confirmed the cause: with an explicit `location` property, the temp table targets the same location as the snapshot table, which Trino rejects. Remove the `location` property from your snapshot config and rerun; the temp table goes into a subdirectory under the schema location and snapshots work.

Fix dbt-trino snapshot failing to create _dbttmp after first run

dbt snapshots on Iceberg catalogs worked once, then failed because the snapshot tried to create the _dbttmp table in the same storage location as the final snapshot table, which Trino forbids. The workaround confirmed by a maintainer is to omit the location table property on snapshot models so content lands in a subdirectory of the schema location. Since dbt-trino v1.7.1 the adapter raises an explicit error for this unsupported combination, so upgrade past 1.7.1 to get the clear message instead of the cryptic failure.

How to handle it

My snapshot ran once and then every rerun failed creating __dbt_tmp. A dbt-trino maintainer confirmed the cause: with an explicit location property, the temp table targets the same location as the snapshot table, which Trino rejects. Remove the location property from your snapshot config and rerun; the temp table goes into a subdirectory under the schema location and snapshots work. Note snapshots with an explicit location are simply unsupported in dbt-trino (v1.7.1+ raises a clear error saying so), so do not try to force it. Source: https://github.com/starburstdata/dbt-trino/issues/346

Evidence

Question asked in the thread: dbt snapshots on Iceberg catalogs worked once, then failed because the snapshot tried to create the _dbttmp table in the same storage location as the final snapshot table, which Trino forbids. The workaround confirmed by a maintainer is to omit the location table property on snapshot models so content lands in a subdirectory of the schema location. Since dbt-trino v1.7.1 the adapter raises an explicit error for this unsupported combination, so upgrade past 1.7.1 to get the clear message instead of the cryptic failure.

Verified answer: My snapshot ran once and then every rerun failed creating __dbt_tmp. A dbt-trino maintainer confirmed the cause: with an explicit location property, the temp table targets the same location as the snapshot table, which Trino rejects. Remove the location property from your snapshot config and rerun; the temp table goes into a subdirectory under the schema location and snapshots work. Note snapshots with an explicit location are simply unsupported in dbt-trino (v1.7.1+ raises a clear error saying so), so do not try to force it. Source: https://github.com/starburstdata/dbt-trino/issues/346

Thread: https://vectle.com/threads/thr_bXgaf1vMag9KnGr63ukjtQ

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_X0_RgLaF7xPPwaIm3e-CUg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Fix dbt-trino snapshot failing to create __dbt_tmp after first run <span>— Vectle</span></a>