You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dbt's Snowflake table materialization can errantly assume that an existing backup relation is of the wrong type. The materialization assumes that the backup_relation is of the same type as the old_relation, which is not necessarily true:
dbt issued a drop table ... statement whereas it should have issued a drop view ... statement for the backup relation.
System information
The output of dbt --version:
>= 0.10.2
Steps to reproduce
The database needs to be in a very weird state to trigger this bug. There needs to be a {identifier}__dbt_backup relation with a different type than the {identifier} relation.
-- models/test_relation.sql
{{ config(materialized='table') }}
select 1 as id
^ Importantly, this needs to be materialized as a table. The view materialization does not suffer from this bug, as we do not use a backup relation there. See also: #1101
The text was updated successfully, but these errors were encountered:
Issue
Issue description
dbt's Snowflake table materialization can errantly assume that an existing backup relation is of the wrong type. The materialization assumes that the
backup_relation
is of the same type as theold_relation
, which is not necessarily true:https://github.com/fishtown-analytics/dbt/blob/371e8b438ab0939f000e3844162c50644f19d6d8/dbt/include/global_project/macros/materializations/table/snowflake_table.sql#L17
Results
dbt issued a
drop table ...
statement whereas it should have issued adrop view ...
statement for the backup relation.System information
The output of
dbt --version
:Steps to reproduce
The database needs to be in a very weird state to trigger this bug. There needs to be a
{identifier}__dbt_backup
relation with a different type than the{identifier}
relation.Then run a model like:
^ Importantly, this needs to be materialized as a table. The view materialization does not suffer from this bug, as we do not use a backup relation there. See also: #1101
The text was updated successfully, but these errors were encountered: