diff --git a/dbt/adapters/snowflake/impl.py b/dbt/adapters/snowflake/impl.py index ac0d903db..10ad2a8a1 100644 --- a/dbt/adapters/snowflake/impl.py +++ b/dbt/adapters/snowflake/impl.py @@ -77,6 +77,7 @@ class SnowflakeAdapter(SQLAdapter): Capability.TableLastModifiedMetadata: CapabilitySupport(support=Support.Full), Capability.TableLastModifiedMetadataBatch: CapabilitySupport(support=Support.Full), Capability.GetCatalogForSingleRelation: CapabilitySupport(support=Support.Full), + Capability.MicrobatchConcurrency: CapabilitySupport(support=Support.Full), } ) diff --git a/dbt/include/snowflake/macros/materializations/incremental.sql b/dbt/include/snowflake/macros/materializations/incremental.sql index dbb79de02..a3a3c38e5 100644 --- a/dbt/include/snowflake/macros/materializations/incremental.sql +++ b/dbt/include/snowflake/macros/materializations/incremental.sql @@ -80,7 +80,9 @@ {%- set unique_key = config.get('unique_key') -%} {% set incremental_strategy = config.get('incremental_strategy') or 'default' %} {% set tmp_relation_type = dbt_snowflake_get_tmp_relation_type(incremental_strategy, unique_key, language) %} - {% set tmp_relation = make_temp_relation(this).incorporate(type=tmp_relation_type) %} + + {% set tmp_relation_suffix = '__dbt_tmp' if not model.batch else '__dbt_tmp_' ~ model.batch.id %} + {% set tmp_relation = make_temp_relation(this, suffix=tmp_relation_suffix).incorporate(type=tmp_relation_type) %} {% set grant_config = config.get('grants') %}