Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use create or replace table in Snowflake table materialization #1101

Closed
drewbanin opened this issue Oct 30, 2018 · 2 comments
Closed

use create or replace table in Snowflake table materialization #1101

drewbanin opened this issue Oct 30, 2018 · 2 comments
Labels
enhancement New feature or request snowflake

Comments

@drewbanin
Copy link
Contributor

Feature

Feature description

dbt should use the create or replace table syntax in its Snowflake table materialization.

Presently, dbt's Snowflake table materialization runs by:

  1. creating a table with a tmp suffix
  2. renaming the old table out of the way
  3. renaming the new table into place

Since Snowflake's transactions aren't serializable, a query issued against Snowflake between steps 2 and 3 will result in an error.

Instead, dbt should use create or replace table for tables (as it currently does for views) to atomically replace a table.

Who will this benefit?

Snowflake users who run dbt frequently

@bastienboutonnet
Copy link
Contributor

working snowflake adaptor for this. discussed with @drewbanin will be submitting PR soon 🎉

@drewbanin
Copy link
Contributor Author

Fixed in #1409

@drewbanin drewbanin added this to the Wilt Chamberlain milestone May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request snowflake
Projects
None yet
Development

No branches or pull requests

2 participants