{"record":{"id":"73cb75c5463a195b","repo":"dbt-labs/dbt-core","slug":"materialized-view-from-relation-config-can-only","errorCode":null,"errorMessage":"'materialized_view_from_relation_config' can only be invoked using the BigQuery adapter","messagePattern":"'materialized_view_from_relation_config' can only be invoked using the BigQuery adapter","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/relation_object.rs","lineNumber":754,"sourceCode":"        self.0.as_ref()\n    }\n}\n\nimpl Object for StaticBaseRelationObject {\n    fn call_method(\n        self: &Arc<Self>,\n        _state: &State,\n        name: &str,\n        args: &[Value],\n        _listeners: &[std::rc::Rc<dyn RenderingEventListener>],\n    ) -> Result<Value, minijinja::Error> {\n        match name {\n            \"create\" => self.create(args),\n            \"scd_args\" => self.scd_args(args),\n            // // The following is required by BigQuery materialized_views\n            \"materialized_view_from_relation_config\" => {\n                if self.0.get_adapter_type() != AdapterType::Bigquery.as_ref() {\n                    return Err(minijinja::Error::new(\n                        minijinja::ErrorKind::InvalidOperation,\n                        \"'materialized_view_from_relation_config' can only be invoked using the BigQuery adapter\",\n                    ));\n                }\n\n                let iter = ArgsIter::new(\n                    \"Relation.materialized_view_from_relation_config\",\n                    &[\"local_config\"],\n                    args,\n                );\n                let local_config_value = iter.next_arg::<&Value>()?;\n                iter.finish()?;\n\n                let local_config = minijinja_value_to_typed_struct::<InternalDbtNodeWrapper>(\n                    local_config_value.clone(),\n                )\n                .map_err(|e| {\n                    minijinja::Error::new(","sourceCodeStart":736,"sourceCodeEnd":772,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/relation_object.rs#L736-L772","documentation":"The `materialized_view_from_relation_config` method on the relation object is BigQuery-specific; it exists because BigQuery materialized view macros need to rebuild a materialized view from its relation config. Calling it under any other adapter raises this InvalidOperation error before any argument parsing happens.","triggerScenarios":"Invoking `relation.materialized_view_from_relation_config(...)` in a Jinja macro while `adapter.type()` is not `bigquery`.","commonSituations":"Running BigQuery materialized-view macros (e.g. from dbt-bigquery's materialization) against another adapter; copying BigQuery materialization code into a Snowflake/Databricks project.","solutions":["Only call this method in BigQuery-specific macros; guard with `{% if adapter.type() == 'bigquery' %}`.","For other adapters, use their native materialized-view support instead of this config-reconstruction path.","Verify the target materialization is `bigquery` (not e.g. a shared materialized_view materialization copied between projects)."],"exampleFix":"// before\n{{ relation.materialized_view_from_relation_config(relation_results, relation_config) }}\n// after\n{% if adapter.type() == 'bigquery' %}\n  {{ relation.materialized_view_from_relation_config(relation_results, relation_config) }}\n{% endif %}","handlingStrategy":"validation","validationCode":"{% if adapter.type() != 'bigquery' %}\n  {% do exceptions.raise_compiler_error('materialized_view_from_relation_config requires BigQuery') %}\n{% endif %}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Guard BigQuery-specific methods behind adapter type checks.","Do not copy BigQuery materialization macros into other-adapter projects unmodified.","Keep adapter-specific materializations in their adapter's include path."],"tags":["jinja","bigquery","materialized-view","adapter"],"backgroundTag":"unsupported-operation","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"}