I am using the incremental_strategy=‘insert’ in one of my models. My adapter is Snowflake. The first time that I run the model everything works fine. But the second time an error is raised because a temp view that i created the same time is being delete the second time. The problem is that the adapter changes the view to a table and of course it fails.
Error in snowflake is “SQL compilation error: Object found is of type ‘VIEW’, not specified type ‘TABLE’.”
so I am trying to follow the call sequence to the culprit. which is as follows:
{% set tmp_relation_type = dbt_snowflake_get_tmp_relation_type(incremental_strategy, unique_key, 'sql') %}
Then it goes into dbt file dbt/include/global_project/macros/adapters/relation.sql
{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}
{{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}
{% endmacro %}
I am not sure where that call resolves to. Can somebody please explain me where it goes?