risingwavelabs/risingwave · error · SinkError::Config

`{MEMBER_NAME}` must be set to `varchar` and `primary_key`

Error message

`{MEMBER_NAME}` must be set to `varchar` and `primary_key`

What it means

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).

Source

Thrown at src/connector/src/sink/redis.rs:416

                        )));
                    }
                    if let Some(lat_type) = all_map.get(lat_name)
                        && (lat_type == &DataType::Float64
                            || lat_type == &DataType::Float32
                            || lat_type == &DataType::Varchar)
                    {
                        // do nothing
                    } else {
                        return Err(SinkError::Config(anyhow!(
                            "`{LAT_NAME}` must be set to `float64` or `float32` or `varchar`"
                        )));
                    }
                    if let Some(member_type) = pk_map.get(member_name)
                        && member_type == &DataType::Varchar
                    {
                        // do nothing
                    } else {
                        return Err(SinkError::Config(anyhow!(
                            "`{MEMBER_NAME}` must be set to `varchar` and `primary_key`"
                        )));
                    }
                }
                Some(REDIS_VALUE_TYPE_PUBSUB) => {
                    let channel = self.format_desc.options.get(CHANNEL);
                    let channel_column = self.format_desc.options.get(CHANNEL_COLUMN);
                    if (channel.is_none() && channel_column.is_none())
                        || (channel.is_some() && channel_column.is_some())
                    {
                        return Err(SinkError::Config(anyhow!(
                            "`{CHANNEL}` and `{CHANNEL_COLUMN}` only one can be set"
                        )));
                    }

                    if let Some(channel_column) = channel_column
                        && let Some(channel_column_type) = all_map.get(channel_column)
                        && (channel_column_type != &DataType::Varchar)

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Make the member column a VARCHAR primary-key column of the upstream table/mv (PRIMARY KEY (member_col, ...))
  2. Or point the `member` option at an existing varchar primary-key column
  3. Ensure the sink has a primary key specified at all, since Redis sinks require one

Example fix

-- before: member = 'device_id' where device_id is INTEGER and not a PK
CREATE MATERIALIZED VIEW mv AS SELECT device_id::VARCHAR AS device_id, ... PRIMARY KEY (device_id);
-- after
... encode template (redis_value_type = 'geospatial', member = 'device_id', ...)
Defensive patterns

Strategy: type-guard

Validate before calling

-- guard before CREATE SINK:
-- pk_cols = primary key columns of sink; member_col = options['member']
-- require member_col in pk_cols AND schema[member_col] == 'character varying'

Try / catch

match result.err() { Some(e) if e.contains("member") => make_member_varchar_pk(), _ => propagate(result) }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/74ebad0bc43e6a92. Report an issue: GitHub.