{"record":{"id":"74ebad0bc43e6a92","repo":"risingwavelabs/risingwave","slug":"member-name-must-be-set-to-varchar-and-prim","errorCode":null,"errorMessage":"`{MEMBER_NAME}` must be set to `varchar` and `primary_key`","messagePattern":"`(.+?)` must be set to `varchar` and `primary_key`","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/redis.rs","lineNumber":416,"sourceCode":"                        )));\n                    }\n                    if let Some(lat_type) = all_map.get(lat_name)\n                        && (lat_type == &DataType::Float64\n                            || lat_type == &DataType::Float32\n                            || lat_type == &DataType::Varchar)\n                    {\n                        // do nothing\n                    } else {\n                        return Err(SinkError::Config(anyhow!(\n                            \"`{LAT_NAME}` must be set to `float64` or `float32` or `varchar`\"\n                        )));\n                    }\n                    if let Some(member_type) = pk_map.get(member_name)\n                        && member_type == &DataType::Varchar\n                    {\n                        // do nothing\n                    } else {\n                        return Err(SinkError::Config(anyhow!(\n                            \"`{MEMBER_NAME}` must be set to `varchar` and `primary_key`\"\n                        )));\n                    }\n                }\n                Some(REDIS_VALUE_TYPE_PUBSUB) => {\n                    let channel = self.format_desc.options.get(CHANNEL);\n                    let channel_column = self.format_desc.options.get(CHANNEL_COLUMN);\n                    if (channel.is_none() && channel_column.is_none())\n                        || (channel.is_some() && channel_column.is_some())\n                    {\n                        return Err(SinkError::Config(anyhow!(\n                            \"`{CHANNEL}` and `{CHANNEL_COLUMN}` only one can be set\"\n                        )));\n                    }\n\n                    if let Some(channel_column) = channel_column\n                        && let Some(channel_column_type) = all_map.get(channel_column)\n                        && (channel_column_type != &DataType::Varchar)","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/redis.rs#L398-L434","documentation":"For a Redis geospatial sink, the `member` option must name a varchar column that is part of the sink's primary key, because the member identifies the entry inside the GEOSET. RedisSink::validate raises this SinkError::Config when the column named by `member` is not varchar or is not a primary-key column (or the name does not exist in the pk map).","triggerScenarios":"CREATE SINK with encode template, redis_value_type = 'geospatial', where `member = '<col>'` references a non-varchar column, a non-primary-key column, or a non-existent column name (src/connector/src/sink/redis.rs:411-419).","commonSituations":"Pointing `member` at an integer id column; choosing a non-PK column as member; forgetting to declare a primary key so pk_map lacks the column; typos in the column name.","solutions":["Make the member column a VARCHAR primary-key column of the upstream table/mv (PRIMARY KEY (member_col, ...))","Or point the `member` option at an existing varchar primary-key column","Ensure the sink has a primary key specified at all, since Redis sinks require one"],"exampleFix":"-- before: member = 'device_id' where device_id is INTEGER and not a PK\nCREATE MATERIALIZED VIEW mv AS SELECT device_id::VARCHAR AS device_id, ... PRIMARY KEY (device_id);\n-- after\n... encode template (redis_value_type = 'geospatial', member = 'device_id', ...)","handlingStrategy":"type-guard","validationCode":"-- guard before CREATE SINK:\n-- pk_cols = primary key columns of sink; member_col = options['member']\n-- require member_col in pk_cols AND schema[member_col] == 'character varying'","typeGuard":null,"tryCatchPattern":"match result.err() { Some(e) if e.contains(\"member\") => make_member_varchar_pk(), _ => propagate(result) }","preventionTips":["Always declare a primary key including the member column upstream","Use VARCHAR for member columns used in Redis GEOSETs","Check that the member option references a real PK column name"],"tags":["redis","sink","type-mismatch","primary-key","geospatial"],"backgroundTag":"invalid-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"}