{"record":{"id":"18fad2565692565f","repo":"risingwavelabs/risingwave","slug":"sink-format-encode-key-encode-unsupported","errorCode":null,"errorMessage":"sink format/encode/key_encode unsupported: {:?} {:?} {:?}","messagePattern":"sink format/encode/key_encode unsupported: (.+?) (.+?) (.+?)","errorType":"validation","errorClass":"SinkError","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/formatter/mod.rs","lineNumber":593,"sourceCode":"                }\n                (F::Upsert, E::Template, None) => Impl::UpsertTemplate(build(p).await?),\n                (F::Debezium, E::Json, None) => Impl::DebeziumJson(build(p).await?),\n                (F::AppendOnly | F::Upsert, E::Text, _) => {\n                    return Err(SinkError::Config(anyhow!(\n                        \"ENCODE TEXT is only valid as key encode.\"\n                    )));\n                }\n                (F::AppendOnly, E::Avro, _)\n                | (F::Upsert, E::Protobuf, _)\n                | (F::Upsert, E::Bytes, _)\n                | (F::Debezium, E::Json, Some(_))\n                | (F::Debezium, E::Avro | E::Protobuf | E::Template | E::Text | E::Bytes, _)\n                | (_, E::Parquet, _)\n                | (_, _, Some(E::Parquet))\n                | (F::AppendOnly, E::Bytes, Some(_))\n                | (F::AppendOnly | F::Upsert, _, Some(E::Template) | Some(E::Json) | Some(E::Avro) | Some(E::Protobuf)) // reject other encode as key encode\n                => {\n                    return Err(SinkError::Config(anyhow!(\n                        \"sink format/encode/key_encode unsupported: {:?} {:?} {:?}\",\n                        format_desc.format,\n                        format_desc.encode,\n                        format_desc.key_encode\n                    )));\n                }\n            },\n        )\n    }\n}\n\n/// Macro to dispatch formatting implementation for all supported sink formatter types.\n/// Used when the message key can be either bytes or string.\n///\n/// Takes a formatter implementation ($impl), binds it to a name ($name),\n/// and executes the provided code block ($body) with that binding.\n#[macro_export]\nmacro_rules! dispatch_sink_formatter_impl {","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/formatter/mod.rs#L575-L611","documentation":"The sink formatter dispatcher validates the full combination of (format, encode, key_encode) against a whitelist of supported tuples. Any combination not matched by an earlier arm — e.g. Parquet anywhere, Debezium with Avro/Protobuf/Template/Text/Bytes, or unsupported encodes used as key encode — falls into this catch-all arm and raises this configuration error listing the three values.","triggerScenarios":"CREATE SINK with any unsupported combination such as `ENCODE PARQUET`, `FORMAT DEZEBZIUM ENCODE AVRO`, `ENCODE BYTES` for append-only with a key encode, or JSON/Avro/Protobuf/Template used as key_encode for AppendOnly/Upsert sinks.","commonSituations":"Copying sink DDL from an older RisingWave version or another system where the combination was allowed; guessing at encodes like Parquet that are never supported for sinks.","solutions":["Review the three values printed in the message and change the unsupported one (usually encode or key_encode)","Use FORMAT DEBEZIUM ENCODE JSON, or APPEND-ONLY/UPSERT with ENCODE JSON/Avro/Protobuf/Template/Bytes as supported in this version","Check the formatter match table in src/connector/src/sink/formatter/mod.rs for the exact supported tuples"],"exampleFix":"// before\nCREATE SINK s FROM mv WITH (connector='kafka', FORMAT DEBEZIUM ENCODE AVRO);\n// after\nCREATE SINK s FROM mv WITH (connector='kafka', FORMAT DEBEZIUM ENCODE JSON);","handlingStrategy":"validation","validationCode":"fn validate_combination(format: &str, encode: &str, key_encode: Option<&str>) -> Result<(), String> {\n    if encode.eq_ignore_ascii_case(\"parquet\") || key_encode.map_or(false, |k| k.eq_ignore_ascii_case(\"parquet\")) {\n        return Err(\"Parquet encode is not supported for sinks\".into());\n    }\n    if format.eq_ignore_ascii_case(\"debezium\") && !encode.eq_ignore_ascii_case(\"json\") {\n        return Err(\"Debezium sinks only support ENCODE JSON\".into());\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use combinations from the supported tuple table in the formatter dispatcher","Never use Parquet encode in sink definitions","Lint sink DDL against a whitelist before applying"],"tags":["sink","encode","config"],"backgroundTag":"unsupported-config-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"}