{"record":{"id":"afe4755c65b8f2c8","repo":"risingwavelabs/risingwave","slug":"must-be-or-afe475","errorCode":null,"errorMessage":"`{}` must be {}, or {}","messagePattern":"`(.+?)` must be (.+?), or (.+?)","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/snowflake_redshift/snowflake.rs","lineNumber":235,"sourceCode":"                }\n            }\n            _ => {\n                // This should never happen since from_btreemap validates auth_method\n                unreachable!(\n                    \"Invalid auth_method - should have been caught during config validation\"\n                )\n            }\n        }\n\n        Ok((jdbc_url, connection_properties))\n    }\n\n    pub fn from_btreemap(properties: &BTreeMap<String, String>) -> Result<Self> {\n        let mut config =\n            serde_json::from_value::<SnowflakeV2Config>(serde_json::to_value(properties).unwrap())\n                .map_err(|e| SinkError::Config(anyhow!(e)))?;\n        if config.r#type != SINK_TYPE_APPEND_ONLY && config.r#type != SINK_TYPE_UPSERT {\n            return Err(SinkError::Config(anyhow!(\n                \"`{}` must be {}, or {}\",\n                SINK_TYPE_OPTION,\n                SINK_TYPE_APPEND_ONLY,\n                SINK_TYPE_UPSERT\n            )));\n        }\n        if config.r#type == SINK_TYPE_UPSERT && !config.with_s3 {\n            return Err(SinkError::Config(anyhow!(\n                \"Snowflake upsert sinks require `with_s3 = true` so all CDC rows are loaded by the serialized COPY INTO task\"\n            )));\n        }\n        let has_upsert_task_config = config.snowflake_cdc_table_name.is_some()\n            || properties.contains_key(\"write.target.interval.seconds\")\n            || config.snowflake_warehouse.is_some()\n            || config.task_serverless\n            || config.task_target_completion_interval.is_some();\n        if config.r#type != SINK_TYPE_UPSERT && has_upsert_task_config {\n            return Err(SinkError::Config(anyhow!(","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/snowflake_redshift/snowflake.rs#L217-L253","documentation":"After deserialization, `from_btreemap` checks the sink `type` option: it must be either `append-only` or `upsert` for the Snowflake sink. Any other value fails this Config error listing the accepted values. The sink's write path depends on this mode, so it is validated eagerly at creation.","triggerScenarios":"Creating a Snowflake sink with `type` set to anything other than `append-only` or `upsert`, e.g. `type='debezium'`, `type='insert'`, or a misspelled `type='append_only'`.","commonSituations":"Copying sink definitions from other connectors (e.g. JDBC/debezium sinks) whose accepted type values differ; typos like `append_only`; omitting `type` when required.","solutions":["Set `type = 'append-only'` or `type = 'upsert'` in the sink WITH options.","Use underscores, not hyphens: `append_only` and similar misspellings are rejected.","Match the type to the source: upsert if the materialized view has primary keys/updates, otherwise append-only."],"exampleFix":"// before\nWITH (connector='snowflake', ..., type='append_only');\n// after\nWITH (connector='snowflake', ..., type='append-only');","handlingStrategy":"validation","validationCode":"let t = props.get(\"type\").map(String::as_str);\nif !matches!(t, Some(\"append-only\") | Some(\"upsert\")) {\n    return Err(anyhow!(\"type must be append-only or upsert\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use 'append-only' or 'upsert' as sink type for Snowflake.","Don't copy type values from other connector sink definitions."],"tags":["rust","snowflake","sink-config","invalid-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}