{"record":{"id":"51bf098d9338c5b8","repo":"dbt-labs/dbt-core","slug":"insert-overwrite-use-replace-on-for-insert-overwr","errorCode":null,"errorMessage":"insert_overwrite: use_replace_on_for_insert_overwrite is enabled but this cluster's DBR version does not support REPLACE ON (requires DBR 17.1+). Falling back to legacy INSERT OVERWRITE.","messagePattern":"insert_overwrite: use_replace_on_for_insert_overwrite is enabled but this cluster's DBR version does not support REPLACE ON \\(requires DBR 17\\.1\\+\\)\\. Falling back to legacy INSERT OVERWRITE\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-loader/src/dbt_macro_assets/dbt-databricks/macros/materializations/incremental/strategies.sql","lineNumber":39,"sourceCode":"\n{% macro get_incremental_replace_where_sql(arg_dict) %}\n\n  {{ return(adapter.dispatch('get_incremental_replace_where_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}\n\n{% macro databricks__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) %}\n    {{ return(get_insert_overwrite_sql(source, target)) }}\n{% endmacro %}\n\n{% macro get_insert_overwrite_sql(source_relation, target_relation) %}\n    {%- if adapter.is_cluster() -%}\n        {#-- Clusters: Check DBR capability for REPLACE ON (DBR 17.1+) --#}\n        {%- if adapter.has_dbr_capability('replace_on') -%}\n            {{ get_insert_replace_on_sql(source_relation, target_relation) }}\n        {%- else -%}\n            {%- if adapter.behavior.use_replace_on_for_insert_overwrite -%}\n                {{ exceptions.warn(\"insert_overwrite: use_replace_on_for_insert_overwrite is enabled but this cluster's DBR version does not support REPLACE ON (requires DBR 17.1+). Falling back to legacy INSERT OVERWRITE.\") }}\n            {%- endif -%}\n            {%- set has_insert_by_name = adapter.has_dbr_capability('insert_by_name') -%}\n            insert overwrite table {{ target_relation }}\n            {{ partition_cols(label=\"partition\") }}\n            {%- if has_insert_by_name %} by name{% endif %}\n            select * from {{ source_relation }}\n        {%- endif -%}\n    {%- else -%}\n        {%- if adapter.behavior.use_replace_on_for_insert_overwrite -%}\n            {{ get_insert_replace_on_sql(source_relation, target_relation) }}\n        {%- else -%}\n            {#-- Behavior flag disabled, use legacy DPO INSERT OVERWRITE --#}\n            {%- set has_insert_by_name = adapter.has_dbr_capability('insert_by_name') -%}\n            insert overwrite table {{ target_relation }}\n            {{ partition_cols(label=\"partition\") }}\n            {%- if has_insert_by_name %} by name{% endif %}\n            select * from {{ source_relation }}\n        {%- endif -%}","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-loader/src/dbt_macro_assets/dbt-databricks/macros/materializations/incremental/strategies.sql#L21-L57","documentation":"Error \"insert_overwrite: use_replace_on_for_insert_overwrite is enabled but this cluster's DBR version does not support REPLACE ON (requires DBR 17.1+). Falling back to legacy INSERT OVERWRITE.\" thrown in dbt-labs/dbt-core.","triggerScenarios":"Thrown at crates/dbt-loader/src/dbt_macro_assets/dbt-databricks/macros/materializations/incremental/strategies.sql:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Upgrade the cluster to DBR 17.1+ so REPLACE ON is available for insert_overwrite","Accept the documented fallback to legacy INSERT OVERWRITE on older DBR clusters","Disable use_replace_on_for_insert_overwrite to silence the capability check"],"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"}