{"record":{"id":"bfebad08b654a2da","repo":"risingwavelabs/risingwave","slug":"unrecognized-value","errorCode":null,"errorMessage":"unrecognized {} value {}","messagePattern":"unrecognized (.+?) value (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/codec/src/decoder/avro/schema.rs","lineNumber":66,"sourceCode":"/// How to convert the map type from the input encoding to RisingWave's datatype.\n///\n/// XXX: Should this be `avro.map.handling.mode`? Can it be shared between Avro and Protobuf?\n#[derive(Debug, Copy, Clone)]\npub enum MapHandling {\n    Jsonb,\n    Map,\n}\n\nimpl MapHandling {\n    pub const OPTION_KEY: &'static str = \"map.handling.mode\";\n\n    pub fn from_options(\n        options: &std::collections::BTreeMap<String, String>,\n    ) -> anyhow::Result<Option<Self>> {\n        let mode = match options.get(Self::OPTION_KEY).map(std::ops::Deref::deref) {\n            Some(\"jsonb\") => Self::Jsonb,\n            Some(\"map\") => Self::Map,\n            Some(v) => bail!(\"unrecognized {} value {}\", Self::OPTION_KEY, v),\n            None => return Ok(None),\n        };\n        Ok(Some(mode))\n    }\n}\n\n/// This function expects original schema (with `Ref`).\n/// TODO: change `map_handling` to some `Config`, and also unify debezium.\npub fn avro_schema_to_fields(\n    schema: &Schema,\n    map_handling: Option<MapHandling>,\n) -> anyhow::Result<Vec<Field>> {\n    let resolved = ResolvedSchema::try_from(schema)?;\n    let mut ancestor_records: Vec<String> = vec![];\n    let root_type = avro_type_mapping(\n        schema,\n        &mut ancestor_records,\n        resolved.get_names(),","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/codec/src/decoder/avro/schema.rs#L48-L84","documentation":"MapHandling::from_options rejects an unknown value for its config option (only \"jsonb\" and \"map\" are supported). It is thrown via anyhow::bail! whenever the option key is present but its value matches neither accepted mode. This prevents silently misinterpreting how Avro map-typed fields should be decoded.","triggerScenarios":"Calling MapHandling::from_options with a BTreeMap that contains the MapHandling OPTION_KEY set to any value other than \"jsonb\" or \"map\" (e.g. \"json\", \"object\", or a typo like \"jsonb \" with trailing whitespace).","commonSituations":"Debezium/Avro connector config with a misspelled or outdated value for the map handling option; copy-pasting config from docs for a different engine; whitespace/case mistakes like \"JSONB\".","solutions":["Set the option value to exactly \"jsonb\" or \"map\" (lowercase, no whitespace).","Remove the option key entirely if the default (no map handling) is desired.","Check the connector config for typos or trailing characters and validate casing."],"exampleFix":"// before\nproperties['codec.decoding.avro.map-handling'] = 'Jsonb';\n// after\nproperties['codec.decoding.avro.map-handling'] = 'jsonb';","handlingStrategy":"validation","validationCode":"const ALLOWED = [\"jsonb\", \"map\"];\nconst v = options.get(\"codec.decoding.avro.map-handling\");\nif (v !== undefined && !ALLOWED.includes(v)) {\n  throw new Error(`unrecognized map-handling value ${v}; expected one of ${ALLOWED.join(\", \")}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep connector option values in a shared constant/enum rather than inline strings.","Validate source options at config submission time, not at decode time.","Watch for case and whitespace when copying values from documentation."],"tags":["avro","config-validation","rust"],"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"}