{"record":{"id":"53ee6535dad85e16","repo":"dbt-labs/dbt-core","slug":"insert-overwrite-is-only-properly-supported-on-all","errorCode":null,"errorMessage":"INSERT OVERWRITE is only properly supported on all-purpose clusters.  On SQL Warehouses, this strategy would be equivalent to using the table materialization.","messagePattern":"INSERT OVERWRITE is only properly supported on all-purpose clusters\\.  On SQL Warehouses, this strategy would be equivalent to using the table materialization\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-loader/src/dbt_macro_assets/dbt-databricks/macros/materializations/incremental/incremental.sql","lineNumber":244,"sourceCode":"\n    {{ run_hooks(post_hooks) }}\n  {%- endif -%}\n\n  {%- if incremental_strategy == 'insert_overwrite' and not full_refresh -%}\n    {{ set_overwrite_mode('STATIC') }}\n  {%- endif -%}\n\n  {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}\n\n{% macro set_overwrite_mode(value) %}\n  {% if adapter.is_cluster() %}\n    {%- call statement('Setting partitionOverwriteMode: ' ~ value) -%}\n      set spark.sql.sources.partitionOverwriteMode = {{ value }}\n    {%- endcall -%}\n  {% else %}\n    {{ 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.\") }}\n  {% endif %}\n{% endmacro %}\n\n{% macro get_build_sql(incremental_strategy, target_relation, intermediate_relation) %}\n  {%- set unique_key = config.get('unique_key') -%}\n  {%- set incremental_predicates = config.get('predicates') or config.get('incremental_predicates') -%}\n  {%- set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) -%}\n  {%- set strategy_arg_dict = ({\n          'target_relation': target_relation,\n          'temp_relation': intermediate_relation,\n          'unique_key': unique_key,\n          'dest_columns': none,\n          'incremental_predicates': incremental_predicates}) -%}\n  {{ strategy_sql_macro_func(strategy_arg_dict) }}\n{% endmacro %}\n\n{% macro process_config_changes(target_relation) %}\n  {% set apply_config_changes = config.get('incremental_apply_config_changes', True) | as_bool %}","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-loader/src/dbt_macro_assets/dbt-databricks/macros/materializations/incremental/incremental.sql#L226-L262","documentation":"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.","triggerScenarios":"Thrown at crates/dbt-loader/src/dbt_macro_assets/dbt-databricks/macros/materializations/incremental/incremental.sql:244 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run insert_overwrite models against an all-purpose cluster for proper overwrite semantics","Switch the model to another incremental strategy if targeting a SQL Warehouse","Accept the warning if table-materialization-equivalent behavior is sufficient"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}