risingwavelabs/risingwave · error · SinkError

Cannot find `{MEMBER_NAME}`,please set it.

Error message

Cannot find `{MEMBER_NAME}`,please set it.

What it means

When `redis_value_type = 'geospatial'` and the Redis sink has a primary key, the builder needs the `member` option (the template for the sorted-set member name). If `member` is missing from the WITH options, the build fails with this SinkError::Config.

Source

Thrown at src/connector/src/sink/formatter/mod.rs:337

        match redis_value_type {
            REDIS_VALUE_TYPE_STRING => {
                let option_name = match pk_indices {
                    Some(_) => KEY_FORMAT,
                    None => VALUE_FORMAT,
                };
                let template = b.format_desc.options.get(option_name).ok_or_else(|| {
                    SinkError::Config(anyhow!("Cannot find '{option_name}',please set it."))
                })?;
                Ok(TemplateEncoder::new_string(
                    b.schema,
                    pk_indices,
                    template.clone(),
                ))
            }
            REDIS_VALUE_TYPE_GEO => match pk_indices {
                Some(_) => {
                    let member_name = b.format_desc.options.get(MEMBER_NAME).ok_or_else(|| {
                        SinkError::Config(anyhow!("Cannot find `{MEMBER_NAME}`,please set it."))
                    })?;
                    let template = b.format_desc.options.get(KEY_FORMAT).ok_or_else(|| {
                        SinkError::Config(anyhow!("Cannot find `{KEY_FORMAT}`,please set it."))
                    })?;
                    TemplateEncoder::new_geo_key(
                        b.schema,
                        pk_indices,
                        member_name,
                        template.clone(),
                    )
                }
                None => {
                    let lat_name = b.format_desc.options.get(LAT_NAME).ok_or_else(|| {
                        SinkError::Config(anyhow!("Cannot find `{LAT_NAME}`, please set it."))
                    })?;
                    let lon_name = b.format_desc.options.get(LON_NAME).ok_or_else(|| {
                        SinkError::Config(anyhow!("Cannot find `{LON_NAME}`,please set it."))
                    })?;

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Add `member = '<template>'` to the WITH options of the geospatial sink.
  2. Also ensure `key_format` is set, since the key branch of this code path requires it next.
  3. Verify the sink really has a primary key; if it does not, the code expects `latitude`/`longitude` options instead.

Example fix

// before
WITH (connector='redis', redis.url='...', redis_value_type='geospatial', key_format='%s:geo');
// after
WITH (connector='redis', redis.url='...', redis_value_type='geospatial', key_format='%s:geo', member='%s');
Defensive patterns

Strategy: validation

Validate before calling

if value_type == "geospatial" && has_pk && !with_options.contains_key("member") {
    return Err("Redis geospatial sink with PK requires `member` option".into());
}

Try / catch

match result {
    Err(e) if e.to_string().contains("`member`") => {
        eprintln!("Add `member = '<template>'` to WITH options: {}", e);
    }
    other => other?,
}

Prevention

When it happens

Trigger: Creating a Redis geospatial sink whose table has a primary key but omitting `member = '<template>'` from the WITH clause.

Common situations: Users copy a value-side geospatial sink example (which uses `latitude`/`longitude` instead of `member`) into a primary-key table, so the `member` option is never set.

Understand the failure class

Background: "Must pass :limit option" / "Missing required option" — required option errors explained — this error's family across 41 libraries.

Related errors


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