{"record":{"id":"ce84d4b7683709cc","repo":"dbt-labs/dbt-core","slug":"failed-to-deserialize-redshiftmaterializedviewconf","errorCode":null,"errorMessage":"Failed to deserialize RedshiftMaterializedViewConfig: {e}","messagePattern":"Failed to deserialize RedshiftMaterializedViewConfig: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/relation_impl.rs","lineNumber":1367,"sourceCode":"            return Err(minijinja::Error::new(\n                minijinja::ErrorKind::InvalidOperation,\n                \"Expected a model node\",\n            ));\n        }\n    };\n\n    if model.__base_attr__.materialized != DbtMaterialization::MaterializedView {\n        return Err(minijinja::Error::new(\n            minijinja::ErrorKind::InvalidOperation,\n            format!(\n                \"Unsupported operation for materialization type {}\",\n                &model.__base_attr__.materialized\n            ),\n        ));\n    }\n\n    RedshiftMaterializedViewConfig::try_from(&*model).map_err(|e| {\n        minijinja::Error::new(\n            minijinja::ErrorKind::SerdeDeserializeError,\n            format!(\"Failed to deserialize RedshiftMaterializedViewConfig: {e}\"),\n        )\n    })\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use dbt_schemas::{dbt_types::RelationType, schemas::relations::DEFAULT_RESOLVED_QUOTING};\n\n    mod postgres {\n        use super::*;\n\n        #[test]\n        fn test_try_new_via_static_base_relation() {\n            let relation_type = RelationStatic {\n                adapter_type: AdapterType::Postgres,","sourceCodeStart":1349,"sourceCodeEnd":1385,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/relation_impl.rs#L1349-L1385","documentation":"After confirming the model is a materialized view, converting its node into RedshiftMaterializedViewConfig failed — required Redshift-specific fields (autorefresh, backup, dist/distkey, sort keys, etc.) are missing from the model config or have the wrong types, so the serde conversion errors out.","triggerScenarios":"Thrown at crates/dbt-adapter/src/relation/relation_impl.rs:1367 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fill in the required Redshift materialized-view config fields on the model","Check field types in the model config YAML against the expected schema","Add serde defaults or per-field error detail to pinpoint the bad key"],"exampleFix":null,"handlingStrategy":"validation","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"}