{"record":{"id":"59469423e985a128","repo":"risingwavelabs/risingwave","slug":"unsupported-encoding-for-upsert","errorCode":null,"errorMessage":"unsupported encoding for Upsert","messagePattern":"unsupported encoding for Upsert","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/parser/upsert_parser.rs","lineNumber":42,"sourceCode":"use crate::error::ConnectorResult;\nuse crate::parser::ParserFormat;\nuse crate::parser::unified::kv_event::KvEvent;\nuse crate::source::{SourceColumnDesc, SourceContext, SourceContextRef};\n\n#[derive(Debug)]\npub struct UpsertParser {\n    key_builder: AccessBuilderImpl,\n    payload_builder: AccessBuilderImpl,\n    pub(crate) rw_columns: Vec<SourceColumnDesc>,\n    source_ctx: SourceContextRef,\n}\n\nasync fn build_accessor_builder(config: EncodingProperties) -> ConnectorResult<AccessBuilderImpl> {\n    match config {\n        EncodingProperties::Json(_)\n        | EncodingProperties::Protobuf(_)\n        | EncodingProperties::Avro(_) => Ok(AccessBuilderImpl::new_default(config).await?),\n        _ => bail!(\"unsupported encoding for Upsert\"),\n    }\n}\n\npub fn get_key_column_name(columns: &[SourceColumnDesc]) -> Option<String> {\n    columns.iter().find_map(|column| {\n        if matches!(\n            column.additional_column.column_type,\n            Some(AdditionalColumnType::Key(_))\n        ) {\n            Some(column.name.clone())\n        } else {\n            None\n        }\n    })\n}\n\nimpl UpsertParser {\n    pub async fn new(","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/parser/upsert_parser.rs#L24-L60","documentation":"build_accessor_builder only supports Json, Protobuf, and Avro encodings for upsert sources. Any other EncodingProperties variant (e.g. Debezium AVRO-less encodings, Bytes, Maxwell, Canal native encodings) is rejected because upsert parsing requires a structured key/payload accessor those encodings cannot provide.","triggerScenarios":"Creating an upsert source (CREATE SOURCE ... FORMAT ENCODE ... ) whose encoding type is not one of json/protobuf/avro; e.g. FORMAT PLAIN ENCODE BYTES with UPSERT, or a Debezium/native encoding not mapped to those three variants.","commonSituations":"Configuring a Kafka upsert source with BYTES or an unsupported encoding; copy-pasting a plain-format source DDL and adding UPSERT; version where some encodings were never wired into the upsert path.","solutions":["Change the source DDL to use ENCODE JSON, ENCODE PROTOBUF, or ENCODE AVRO with FORMAT UPSERT/DEBEZIUM.","If the encoding is genuinely supported upstream, add it to the match arm in build_accessor_builder in src/connector/src/parser/upsert_parser.rs.","Verify with SHOW CREATE SOURCE / the docs which encodings the upsert parser supports."],"exampleFix":"// before\nCREATE SOURCE s (...) WITH (connector='kafka', ...) FORMAT UPSERT ENCODE BYTES;\n// after\nCREATE SOURCE s (...) WITH (connector='kafka', ...) FORMAT UPSERT ENCODE AVRO;","handlingStrategy":"validation","validationCode":"const UPSERT_ENCODINGS: &[&str] = &[\"json\", \"protobuf\", \"avro\"];\nfn validate_upsert_encoding(encoding: &str) -> Result<(), String> {\n    if UPSERT_ENCODINGS.contains(&encoding.to_ascii_lowercase().as_str()) {\n        Ok(())\n    } else {\n        Err(format!(\"encoding '{encoding}' unsupported for UPSERT; use one of {UPSERT_ENCODINGS:?}\"))\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair FORMAT UPSERT with ENCODE JSON/PROTOBUF/AVRO in DDL.","Review the supported-encoding matrix in RisingWave docs before creating sources.","Test source creation in dev before promoting DDL to production."],"tags":["connector","upsert","unsupported-encoding","source"],"backgroundTag":"unsupported-operation","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"}