risingwavelabs/risingwave · error · SinkError

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

Error message

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

What it means

For `redis_value_type = 'geospatial'` sinks WITHOUT a primary key, after `latitude` the builder requires the `longitude` option (the longitude column name/template). Missing `longitude` aborts the sink build with this SinkError::Config.

Source

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

                    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."))
                    })?;
                    TemplateEncoder::new_geo_value(b.schema, pk_indices, lat_name, lon_name)
                }
            },
            REDIS_VALUE_TYPE_PUBSUB => match pk_indices {
                Some(_) => {
                    let channel = b.format_desc.options.get(CHANNEL).cloned();
                    let channel_column = b.format_desc.options.get(CHANNEL_COLUMN).cloned();
                    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"
                        )));
                    }
                    TemplateEncoder::new_pubsub_stream_key(
                        b.schema,
                        pk_indices,

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Add `longitude = '<lon-column>'` to the WITH options.
  2. Ensure both `latitude` and `longitude` point to numeric columns in the sink schema.
  3. Verify the sink has no primary key; a primary-key geospatial sink needs `member` and `key_format` instead.

Example fix

// before
WITH (redis_value_type='geospatial', latitude='lat');
// after
WITH (redis_value_type='geospatial', latitude='lat', longitude='lon');
Defensive patterns

Strategy: validation

Validate before calling

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

Try / catch

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

Prevention

When it happens

Trigger: Creating a Redis geospatial sink without a primary key, providing `latitude` but not `longitude` in the WITH options.

Common situations: Users set one coordinate option and forget the other; the error message names exactly which one is missing.

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/7b6b6f049d0165d9. Report an issue: GitHub.