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
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
The snowflake__get_rename_x_sql macros are using unqualified names for the rename target. This ultimately led to an error in #1016 — although I'm glad it did, because if it hadn't, it might have masked the real underlying issue, which is that dbt can no longer recognizes dynamic tables based on the output of show terse objects and is full-refreshing them on every run.
Still, I would expect that these macros return:
altertable"ANALYTICS"."DBT_JCOHEN_DEV"."MY_DYNAMIC_TABLE" rename to "ANALYTICS"."DBT_JCOHEN_DEV".MY_DYNAMIC_TABLE__dbt_backup;
Instead:
altertable"ANALYTICS"."DBT_JCOHEN_DEV"."MY_DYNAMIC_TABLE" rename to MY_DYNAMIC_TABLE__dbt_backup;
Reproduction case in #1016 — the specific error actually surfaces because the temp relation being dropped (qualified name) does not match the temp relation being created (unqualified name)
Relevant log output
08:31:27 On model.my_dbt_project.foo_2024_03_enabled: /* {"app": "dbt", "dbt_version": "1.7.14", "profile_name": "all", "target_name": "sf", "node_id": "model.my_dbt_project.foo_2024_03_enabled"} */
-- get the standard backup name
-- drop any pre-existing backup
drop table if exists "DEVELOPMENT_JYEO"."DBT_JYEO"."FOO_2024_03_ENABLED__dbt_backup" cascade
;
08:31:27 Opening a new connection, currently in state closed
08:31:29 SQL status: SUCCESS 1 in 2.0 seconds
08:31:29 Using snowflake connection "model.my_dbt_project.foo_2024_03_enabled"
08:31:29 On model.my_dbt_project.foo_2024_03_enabled: /* {"app": "dbt", "dbt_version": "1.7.14", "profile_name": "all", "target_name": "sf", "node_id": "model.my_dbt_project.foo_2024_03_enabled"} */
alter table "DEVELOPMENT_JYEO"."DBT_JYEO"."FOO_2024_03_ENABLED" rename to FOO_2024_03_ENABLED__dbt_backup;
08:31:29 Snowflake adapter: Snowflake query id: 01b413bf-0804-98fe-000d-3783323f397a
08:31:29 Snowflake adapter: Snowflake error: 002002 (42710): SQL compilation error:
Object 'FOO_2024_03_ENABLED__DBT_BACKUP' already exists.
Hi @mikealfare. I still see error Object '{{name}}__DBT_BACKUP' already exists, and I'm using dbt-snowflake v1.8.3.
I see that this issue has been closed completed though, whereas this issue is still open: #1103
Are these not related?
Is this a new bug in dbt-snowflake?
Current Behavior
The
snowflake__get_rename_x_sql
macros are using unqualified names for the rename target. This ultimately led to an error in #1016 — although I'm glad it did, because if it hadn't, it might have masked the real underlying issue, which is that dbt can no longer recognizes dynamic tables based on the output ofshow terse objects
and is full-refreshing them on every run.Still, I would expect that these macros return:
Instead:
Expected Behavior
Steps To Reproduce
Reproduction case in #1016 — the specific error actually surfaces because the temp relation being dropped (qualified name) does not match the temp relation being created (unqualified name)
Relevant log output
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: