{"record":{"id":"8a0522afc89208da","repo":"dbt-labs/dbt-core","slug":"resolve-file-format-is-only-supported-in-databrick","errorCode":null,"errorMessage":"resolve_file_format is only supported in Databricks","messagePattern":"resolve_file_format is only supported in Databricks","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/adapter/adapter_impl.rs","lineNumber":4530,"sourceCode":"        }\n    }\n\n    /// When config omits file_format, falls back to this adapter's default (Databricks\n    /// defaults to \"delta\"). Used by clone materialization.\n    ///\n    /// DatabricksAdapter https://github.com/databricks/dbt-databricks/blob/2f11abb306a400cde32b27891b766bf41a11fb1f/dbt/adapters/databricks/impl.py#L994\n    pub fn resolve_file_format(&self, config: ModelConfig) -> AdapterResult<String> {\n        match self.adapter_type() {\n            Databricks => {\n                let file_format = config\n                    .__warehouse_specific_config__\n                    .file_format\n                    .as_deref()\n                    .unwrap_or(\"delta\")\n                    .to_string();\n                Ok(file_format)\n            }\n            _ => unimplemented!(\"resolve_file_format is only supported in Databricks\"),\n        }\n    }\n\n    /// Given a relation, fetch its configurations from the remote data warehouse\n    ///\n    /// DatabricksAdapter https://github.com/databricks/dbt-databricks/blob/7c282cabb518a5e1173222e7901896d31de8401f/dbt/adapters/databricks/impl.py#L1088\n    pub fn get_relation_config(\n        &self,\n        state: &State,\n        conn: &mut dyn Connection,\n        relation: &Arc<dyn BaseRelation>,\n        model_config: Option<&RelationConfig>,\n        token: CancellationToken,\n    ) -> AdapterResult<RelationConfig> {\n        use crate::relation::databricks::config::relation_types;\n\n        if let Replay(_, replay) = self.inner_adapter()\n            && let Some(recorded) = replay.replay_get_relation_config(state)?","sourceCodeStart":4512,"sourceCodeEnd":4548,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/adapter/adapter_impl.rs#L4512-L4548","documentation":"resolve_file_format returns the model's file_format warehouse config, defaulting to 'delta' for Databricks (dbt-databricks impl.py#L994). Unlike its siblings it uses a catch-all `_ =>` arm that panics with unimplemented!(), so every non-Databricks adapter type — including future adapter variants — hits the panic when this is called.","triggerScenarios":"Calling adapter.resolve_file_format(config) from clone/table materialization logic while the adapter is not Databricks (Snowflake, BigQuery, DuckDB, Spark, Postgres, etc.). The catch-all arm at adapter_impl.rs:4530 fires for any non-Databricks adapter_type().","commonSituations":"Clone materialization macros from dbt-databricks run on another warehouse; a macro resolves file_format generically without an adapter guard; multi-platform projects where Databricks-only helpers execute for all targets.","solutions":["Guard with adapter.type() == 'databricks' and use a platform-appropriate default (or the model's own file_format config) elsewhere","Keep resolve_file_format calls inside Databricks-only materialization branches","Verify the active dbt target is Databricks when running models that rely on delta file formats"],"exampleFix":"{% if adapter.type() == 'databricks' %}\n  {% set file_format = adapter.resolve_file_format(config) %}\n{% else %}\n  {% set file_format = config.get('file_format', 'default') %}\n{% endif %}","handlingStrategy":"type-guard","validationCode":"{% if adapter.type() == 'databricks' %}\n  {% set file_format = adapter.resolve_file_format(config) %}\n{% endif %}","typeGuard":"fn is_databricks(adapter: &AdapterImpl) -> bool { adapter.adapter_type() == AdapterType::Databricks }","tryCatchPattern":"// Catch-all unimplemented! arm panics for any non-Databricks type; check first\nif adapter.adapter_type() == AdapterType::Databricks {\n    let file_format = adapter.resolve_file_format(config)?;\n}","preventionTips":["Never call resolve_file_format from platform-neutral materializations","Use the model's own file_format config with a per-platform default elsewhere","Pin clone materializations to Databricks targets in project selectors"],"tags":["adapter","databricks","file-format","unimplemented"],"backgroundTag":"operation-not-supported","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}