dbt-labs/dbt-core · error

INSERT OVERWRITE is only properly supported on all-purpose…

Error message

INSERT OVERWRITE is only properly supported on all-purpose clusters.  On SQL Warehouses, this strategy would be equivalent to using the table materialization.

What it means

Warning from set_overwrite_mode in the Databricks incremental materialization: the model uses the insert_overwrite strategy, but the target is a SQL Warehouse rather than an all-purpose cluster, where INSERT OVERWRITE semantics degrade to what the table materialization already provides. The run continues; the spark.sql.sources.partitionOverwriteMode setting is only applied on clusters.

Solutions

  1. Run insert_overwrite models against an all-purpose cluster for proper overwrite semantics
  2. Switch the model to another incremental strategy if targeting a SQL Warehouse
  3. Accept the warning if table-materialization-equivalent behavior is sufficient
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/dbt-loader/src/dbt_macro_assets/dbt-databricks/macros/materializations/incremental/incremental.sql:244 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/53ee6535dad85e16. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-loader/src/dbt_macro_assets/dbt-databricks/macros/materializations/incremental/incremental.sql:244

    {{ run_hooks(post_hooks) }}
  {%- endif -%}

  {%- if incremental_strategy == 'insert_overwrite' and not full_refresh -%}
    {{ set_overwrite_mode('STATIC') }}
  {%- endif -%}

  {{ return({'relations': [target_relation]}) }}

{%- endmaterialization %}

{% macro set_overwrite_mode(value) %}
  {% if adapter.is_cluster() %}
    {%- call statement('Setting partitionOverwriteMode: ' ~ value) -%}
      set spark.sql.sources.partitionOverwriteMode = {{ value }}
    {%- endcall -%}
  {% else %}
    {{ exceptions.warn("INSERT OVERWRITE is only properly supported on all-purpose clusters.  On SQL Warehouses, this strategy would be equivalent to using the table materialization.") }}
  {% endif %}
{% endmacro %}

{% macro get_build_sql(incremental_strategy, target_relation, intermediate_relation) %}
  {%- set unique_key = config.get('unique_key') -%}
  {%- set incremental_predicates = config.get('predicates') or config.get('incremental_predicates') -%}
  {%- set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) -%}
  {%- set strategy_arg_dict = ({
          'target_relation': target_relation,
          'temp_relation': intermediate_relation,
          'unique_key': unique_key,
          'dest_columns': none,
          'incremental_predicates': incremental_predicates}) -%}
  {{ strategy_sql_macro_func(strategy_arg_dict) }}
{% endmacro %}

{% macro process_config_changes(target_relation) %}
  {% set apply_config_changes = config.get('incremental_apply_config_changes', True) | as_bool %}

View on GitHub (pinned to 0267ce9170)