{"record":{"id":"e2a66e27bf80a254","repo":"risingwavelabs/risingwave","slug":"must-be-or","errorCode":null,"errorMessage":"`{}` must be {}, or {}","messagePattern":"`(.+?)` must be (.+?), or (.+?)","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/big_query.rs","lineNumber":284,"sourceCode":"}\n\ncrate::impl_sink_unknown_fields!(BigQueryConfig);\n\nimpl EnforceSecret for BigQueryConfig {\n    fn enforce_one(prop: &str) -> crate::error::ConnectorResult<()> {\n        BigQueryCommon::enforce_one(prop)?;\n        AwsAuthProps::enforce_one(prop)?;\n        Ok(())\n    }\n}\n\nimpl BigQueryConfig {\n    pub fn from_btreemap(properties: BTreeMap<String, String>) -> Result<Self> {\n        let config =\n            serde_json::from_value::<BigQueryConfig>(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        Ok(config)\n    }\n}\n\n#[derive(Debug)]\npub struct BigQuerySink {\n    pub config: BigQueryConfig,\n    schema: Schema,\n    pk_indices: Vec<usize>,\n    is_append_only: bool,\n}\n","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/big_query.rs#L266-L302","documentation":"`BigQueryConfig::from_btreemap` validates that the `type` sink property is one of the allowed values ('append-only' or 'upsert'). Any other value — even a misspelling or different casing — fails serde parsing or the explicit check, and this error message is returned naming the three acceptable tokens.","triggerScenarios":"Creating a BigQuery sink with `type = 'append'`, `type = 'Append_Only'`, `type = 'insert'`, or any value other than exactly 'append-only' or 'upsert'.","commonSituations":"Copy-pasting a WITH clause from a different connector that uses different type tokens; typos; assuming case-insensitivity.","solutions":["Set `type = 'append-only'` for insert-only sinks","Set `type = 'upsert'` if the sink must handle updates/deletes","Re-create the sink after fixing the WITH clause"],"exampleFix":"// before\nWITH (connector = 'bigquery', type = 'insert')\n// after\nWITH (connector = 'bigquery', type = 'append-only')","handlingStrategy":"validation","validationCode":"const t = props.get(\"type\");\nif (t !== \"append-only\" && t !== \"upsert\") throw new Error(`type must be 'append-only' or 'upsert', got ${t}`);","typeGuard":null,"tryCatchPattern":"match BigQueryConfig::from_btreemap(props) {\n    Err(e) if e.to_string().contains(\"must be append-only, or upsert\") => {\n        eprintln!(\"fix the `type` WITH option\");\n    }\n    _ => {}\n}","preventionTips":["Use exactly 'append-only' or 'upsert', lowercase with hyphen","Check connector docs for valid sink type tokens","Validate the WITH clause with a lint before CREATE SINK"],"tags":["config","validation","bigquery"],"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"}