{"record":{"id":"09647969a6251f27","repo":"dbt-labs/dbt-core","slug":"error-while-loading-local-materialized-view-config","errorCode":null,"errorMessage":"error while loading local materialized view config: {err}","messagePattern":"error while loading local materialized view config: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/relation_object.rs","lineNumber":785,"sourceCode":"\n                let local_config = minijinja_value_to_typed_struct::<InternalDbtNodeWrapper>(\n                    local_config_value.clone(),\n                )\n                .map_err(|e| {\n                    minijinja::Error::new(\n                        minijinja::ErrorKind::SerdeDeserializeError,\n                        format!(\n                            \"get_table_options: Failed to deserialize InternalDbtNodeWrapper: {e}\"\n                        ),\n                    )\n                })?;\n\n                let loader =\n                    crate::relation::bigquery::config::relation_types::materialized_view::new_loader();\n                let relation_config = loader\n                    .from_local_config(local_config.as_internal_node())\n                    .map_err(|err| {\n                        minijinja::Error::new(\n                            minijinja::ErrorKind::InvalidOperation,\n                            format!(\"error while loading local materialized view config: {err}\"),\n                        )\n                    })?;\n                Ok(Value::from_object(relation_config))\n            }\n            \"get_default_quote_policy\" => {\n                let iter = ArgsIter::new(\"Relation.get_default_quote_policy\", &[], args);\n                iter.finish()?;\n                Ok(Value::from_object(QuotePolicyObject(\n                    self.0.get_default_quoting(),\n                )))\n            }\n            _ => Err(minijinja::Error::new(\n                minijinja::ErrorKind::UnknownMethod,\n                format!(\"Unknown method on StaticBaseRelationObject: '{name}'\"),\n            )),\n        }","sourceCodeStart":767,"sourceCodeEnd":803,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/relation_object.rs#L767-L803","documentation":"After deserializing the internal node, `get_table_options` loads the materialized view relation config through the BigQuery `materialized_view::new_loader()`'s `from_local_config`. If the loaded config is invalid for the materialized-view relation type schema, the loader error is wrapped in this InvalidOperation error.","triggerScenarios":"Calling `get_table_options` on a BigQuery relation where `from_local_config` rejects the node's config: wrong relation type (table/sequence instead of materialized_view), invalid option keys, or values failing the config schema validation.","commonSituations":"Materialized view configs with unrecognized or mistyped options (e.g. wrong `enable_refresh`, bad `refresh_interval_minutes` type); calling the method on a node that is not a materialized view; schema drift after a dbt/adapter upgrade.","solutions":["Read the wrapped `err` message to find which config field was rejected and correct it in the model's `config` block.","Ensure the call targets an actual BigQuery materialized view node, not a table or other relation type.","Remove or fix unsupported/typo'd materialized-view option keys in the model config."],"exampleFix":"// before\n{{ config(materialized='materialized_view', refresh_interval_minutes='30') }}\n// after\n{{ config(materialized='materialized_view', refresh_interval_minutes=30) }}","handlingStrategy":"validation","validationCode":"{% if config.get('materialized') != 'materialized_view' %}\n  {% do exceptions.raise_compiler_error('get_table_options requires a materialized view node') %}\n{% endif %}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate materialized-view option names/types against the BigQuery relation config schema.","Ensure option value types are correct (numbers as numbers, booleans as booleans).","Re-run models after upgrading adapters to catch config schema changes."],"tags":["bigquery","materialized-view","config","validation"],"backgroundTag":"invalid-config-value","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"}