Tags: duckdb/dbt-duckdb
Tags
fix write conflict when first creating dbt_temp schema (#584) I believe this fixes the root cause of #513 ## Problem Currently, when using MotherDuck with dbt-duckdb, a real temp schema and real tables will be created to store the staging tables, because temp tables are not yet supported. By default this schema is called `dbt_temp`. When running dbt with 2 or more threads, each incremental model will open a transaction that starts with the statement `CREATE SCHEMA IF NOT EXISTS dbt_temp`. The model that gets executed first will cause a catalog change with the `CREATE SCHEMA` statement while its transaction is still open, while the rest of the models will fail with a write-write conflict on that statement. ## Solution & Considerations If the schema `dbt_temp` already exists, then the `CREATE SCHEMA` statement will be a no-op, then all incremental models will succeed. So ideally, the create schema statement should be run just once at the beginning of a dbt run. But the current implementation allows each model to configure their own temp schema. This means that we won't fully know the name of the schema that needs to be created until processing the model, also that the`CREATE SCHEMA IF NOT EXISTS {temp_schema_name}` statement in `macros/materializations/incremental.sql` needs to be preserved. So the fix will just address the problem of creating the default temp schema `dbt_temp`, by running `CREATE SCHEMA IF NOT EXISTS dbt_temp` when initializing the connection.
Bump dbt-tests-adapter from 1.10.4 to 1.11.0 (#509) Bumps [dbt-tests-adapter](https://github.com/dbt-labs/dbt-adapters) from 1.10.4 to 1.11.0. - [Release notes](https://github.com/dbt-labs/dbt-adapters/releases) - [Changelog](https://github.com/dbt-labs/dbt-adapters/blob/v1.11.0/CHANGELOG.md) - [Commits](dbt-labs/dbt-adapters@v1.10.4...v1.11.0) --- updated-dependencies: - dependency-name: dbt-tests-adapter dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bump dbt-tests-adapter from 1.9.2 to 1.10.2 (#454) Bumps [dbt-tests-adapter](https://github.com/dbt-labs/dbt-adapters) from 1.9.2 to 1.10.2. - [Release notes](https://github.com/dbt-labs/dbt-adapters/releases) - [Changelog](https://github.com/dbt-labs/dbt-adapters/blob/main/CHANGELOG.md) - [Commits](https://github.com/dbt-labs/dbt-adapters/commits) --- updated-dependencies: - dependency-name: dbt-tests-adapter dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
PreviousNext