{"record":{"id":"a10e47681dfdd455","repo":"risingwavelabs/risingwave","slug":"unsupported-as-sink-key-encode","errorCode":null,"errorMessage":"unsupported {} as sink key encode","messagePattern":"unsupported (.+?) as sink key encode","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/catalog/mod.rs","lineNumber":269,"sourceCode":"                return Err(SinkError::Config(anyhow!(\n                    \"sink encode unsupported: {}\",\n                    e.as_str_name()\n                )));\n            }\n        };\n        let key_encode = match &value.key_encode() {\n            E::Bytes => Some(SinkEncode::Bytes),\n            E::Text => Some(SinkEncode::Text),\n            E::Unspecified => None,\n            encode @ (E::Avro\n            | E::Csv\n            | E::Json\n            | E::Protobuf\n            | E::Template\n            | E::Native\n            | E::Parquet\n            | E::None) => {\n                return Err(SinkError::Config(anyhow!(\n                    \"unsupported {} as sink key encode\",\n                    encode.as_str_name()\n                )));\n            }\n        };\n\n        Ok(Self {\n            format,\n            encode,\n            options: value.options,\n            key_encode,\n            secret_refs: value.secret_refs,\n            connection_id: value.connection_id,\n        })\n    }\n}\n\n/// the catalog of the sink. There are two kind of schema here. The full schema is all columns","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/catalog/mod.rs#L251-L287","documentation":"The key_encode option defines how the sink's key is serialized. Values like Json, Protobuf, Template, Native, Parquet, and None cannot be used as a key encode, so try_from rejects them with this config error.","triggerScenarios":"CREATE SINK ... WITH (key_encode='<json|protobuf|template|native|parquet|none>') — i.e. any key_encode value outside the allowed key-encodable set.","commonSituations":"Copying the main `encode` value into `key_encode` assuming they accept the same set; setting key_encode for sinks that derive keys internally.","solutions":["Use a key-capable encode for key_encode (e.g. compatible row-encode formats supported for keys).","Remove the key_encode option entirely if the connector derives keys automatically.","Consult the specific connector docs for which key encodes are valid."],"exampleFix":"// before\nWITH (connector='kafka', format='upsert', encode='json', key_encode='json', ...)\n// after\nWITH (connector='kafka', format='upsert', encode='json', key_encode='bytes', ...) // or omit key_encode","handlingStrategy":"validation","validationCode":"const BAD_KEY_ENCODES = ['json', 'protobuf', 'template', 'native', 'parquet', 'none'];\nif (props.key_encode && BAD_KEY_ENCODES.includes(props.key_encode)) throw new Error(`Unsupported key encode: ${props.key_encode}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit key_encode unless the connector documentation explicitly requires it.","Do not blindly copy `encode` into `key_encode`.","Build sink DDL from vetted templates with valid key encodes."],"tags":["sink","key-encode","config","enum"],"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"}