{"record":{"id":"7c4f09bde84e34c5","repo":"risingwavelabs/risingwave","slug":"stream-and-stream-column-only-one-can-be-s","errorCode":null,"errorMessage":"`{STREAM}` and `{STREAM_COLUMN}` only one can be set","messagePattern":"`(.+?)` and `(.+?)` only one can be set","errorType":"validation","errorClass":"SinkError","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/formatter/mod.rs","lineNumber":395,"sourceCode":"                None => {\n                    let template = b.format_desc.options.get(VALUE_FORMAT).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\"Cannot find '{VALUE_FORMAT}',please set it.\"))\n                    })?;\n                    Ok(TemplateEncoder::new_string(\n                        b.schema,\n                        pk_indices,\n                        template.clone(),\n                    ))\n                }\n            },\n            REDIS_VALUE_TYPE_STREAM => match pk_indices {\n                Some(_) => {\n                    let stream = b.format_desc.options.get(STREAM).cloned();\n                    let stream_column = b.format_desc.options.get(STREAM_COLUMN).cloned();\n                    if (stream.is_none() && stream_column.is_none())\n                        || (stream.is_some() && stream_column.is_some())\n                    {\n                        return Err(SinkError::Config(anyhow!(\n                            \"`{STREAM}` and `{STREAM_COLUMN}` only one can be set\"\n                        )));\n                    }\n                    TemplateEncoder::new_pubsub_stream_key(\n                        b.schema,\n                        pk_indices,\n                        stream,\n                        stream_column,\n                    )\n                }\n                None => {\n                    let value_template =\n                        b.format_desc.options.get(VALUE_FORMAT).ok_or_else(|| {\n                            SinkError::Config(anyhow!(\n                                \"Cannot find '{VALUE_FORMAT}',please set it.\"\n                            ))\n                        })?;\n                    let key_template = b.format_desc.options.get(KEY_FORMAT).ok_or_else(|| {","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/formatter/mod.rs#L377-L413","documentation":"For `redis_value_type = 'stream'` sinks with a primary key, the Redis stream target must be given via exactly one of the mutually exclusive options `stream` (static stream key) or `stream_column` (a column holding the stream key). Setting both, or neither, fails the sink build with this SinkError::Config.","triggerScenarios":"Creating a Redis stream sink with a primary key where the WITH options include both `stream` and `stream_column`, or neither of them.","commonSituations":"Users migrate from a pubsub sink and leave a `channel`-like mix of options behind, or they copy both a static stream name and a stream column from an example and keep both.","solutions":["Keep exactly one of `stream = 'my-stream'` or `stream_column = 'stream_col'`; remove the other.","Use `stream_column` for per-row dynamic stream keys, `stream` for a single fixed stream.","Re-create the sink after cleaning the WITH options."],"exampleFix":"// before\nWITH (redis_value_type='stream', stream='events', stream_column='topic');\n// after\nWITH (redis_value_type='stream', stream_column='topic');  -- or stream='events' only","handlingStrategy":"validation","validationCode":"if value_type == \"stream\" {\n    let s = with_options.contains_key(\"stream\");\n    let sc = with_options.contains_key(\"stream_column\");\n    if s == sc {\n        return Err(\"Set exactly one of `stream` or `stream_column`\".into());\n    }\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"only one can be set\") => {\n        eprintln!(\"Fix stream options (keep exactly one of stream/stream_column): {}\", e);\n    }\n    other => other?,\n}","preventionTips":["Set only one of stream / stream_column per sink","Remove stale options when migrating sinks between static and dynamic stream keys","Review the resolved WITH options, not just the SQL text"],"tags":["redis","sink","stream","configuration","conflicting-options"],"backgroundTag":"conflicting-config-options","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"}