{"record":{"id":"b718a96e53419006","repo":"risingwavelabs/risingwave","slug":"unsupported-combination-of-format-and-encode","errorCode":null,"errorMessage":"Unsupported combination of format {:?} and encode {:?}","messagePattern":"Unsupported combination of format (.+?) and encode (.+?)","errorType":"validation","errorClass":"ConnectorError","httpStatus":null,"severity":"error","filePath":"src/connector/src/source/base.rs","lineNumber":536,"sourceCode":"        }\n        (PbFormatType::Native, PbEncodeType::Native) => {\n            (SourceFormat::Native, SourceEncode::Native)\n        }\n        (PbFormatType::None, PbEncodeType::None) => (SourceFormat::None, SourceEncode::None),\n        (PbFormatType::Debezium, PbEncodeType::Avro) => {\n            (SourceFormat::Debezium, SourceEncode::Avro)\n        }\n        (PbFormatType::Upsert, PbEncodeType::Json) => (SourceFormat::Upsert, SourceEncode::Json),\n        (PbFormatType::Upsert, PbEncodeType::Avro) => (SourceFormat::Upsert, SourceEncode::Avro),\n        (PbFormatType::DebeziumMongo, PbEncodeType::Json) => {\n            (SourceFormat::DebeziumMongo, SourceEncode::Json)\n        }\n        (PbFormatType::Plain, PbEncodeType::Bytes) => (SourceFormat::Plain, SourceEncode::Bytes),\n        (PbFormatType::Upsert, PbEncodeType::Protobuf) => {\n            (SourceFormat::Upsert, SourceEncode::Protobuf)\n        }\n        (format, encode) => {\n            bail!(\n                \"Unsupported combination of format {:?} and encode {:?}\",\n                format,\n                encode\n            );\n        }\n    };\n    Ok(SourceStruct::new(format, encode))\n}\n\n/// Stream of [`SourceMessage`]. Messages flow through the stream in the unit of a batch.\npub type BoxSourceMessageStream =\n    BoxStream<'static, crate::error::ConnectorResult<Vec<SourceMessage>>>;\n/// Stream of source message events.\npub type BoxSourceMessageEventStream =\n    BoxStream<'static, crate::error::ConnectorResult<SourceMessageEvent>>;\n/// Stream of [`StreamChunk`]s parsed from the messages from the external source.\npub type BoxSourceChunkStream = BoxStream<'static, crate::error::ConnectorResult<StreamChunk>>;\n/// Stream of source reader events.","sourceCodeStart":518,"sourceCodeEnd":554,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/base.rs#L518-L554","documentation":"RisingWave validates that the (format, encode) pair given in a source's WITH/FORMAT options is one of the supported combinations (e.g. Plain+Bytes, Upsert+Protobuf). If the pairing is not in the translation table in extract_source_struct, creation is rejected with this message naming both values. It prevents sources being built with encoders that their format cannot consume.","triggerScenarios":"Calling extract_source_struct (via source CREATE/ALTER paths `new` or `handle_alter_source_column`) with a PbFormatType/PbEncodeType pair absent from the match arms, e.g. FORMAT PLAIN ENCODE PROTOBUF or FORMAT DEBEZIUM JSON when unsupported, or a type+encode pairing added to protobuf enums without updating the match.","commonSituations":"Typo or unsupported FORMAT ... ENCODE ... combination in CREATE SOURCE/CREATE TABLE ... WITH connector; enabling a new encode type in the protobuf definitions but forgetting to add the match arm; altering a source's format column pair to an invalid pairing.","solutions":["Pick a supported combination, e.g. FORMAT PLAIN ENCODE BYTES or FORMAT UPSERT ENCODE PROTOBUF","Check the match in extract_source_struct (src/connector/src/source/base.rs) for the exact list of valid pairs and match your options to one","If a new valid pair is genuinely needed, add the (format, encode) arm to extract_source_struct and rebuild"],"exampleFix":"// before\nCREATE SOURCE s (...) WITH (connector='kafka') FORMAT PLAIN ENCODE PROTOBUF;\n// after\nCREATE SOURCE s (...) WITH (connector='kafka') FORMAT PLAIN ENCODE BYTES;","handlingStrategy":"validation","validationCode":"const VALID_PAIRS: &[(PbFormatType, PbEncodeType)] = &[\n    (PbFormatType::Plain, PbEncodeType::Bytes),\n    (PbFormatType::Upsert, PbEncodeType::Protobuf),\n];\nassert!(VALID_PAIRS.contains(&(fmt, enc)), \"unsupported format/encode: {:?}/{:?}\", fmt, enc);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cross-check FORMAT/ENCODE pairs against the match table in extract_source_struct before creating sources","When adding new PbFormatType/PbEncodeType variants, update the match immediately to avoid non-exhaustive gaps reaching runtime"],"tags":["rust","connector","source","config-validation"],"backgroundTag":"unsupported-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"}