risingwavelabs/risingwave · error · SinkError

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

Error message

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

What it means

For `redis_value_type = 'geospatial'` sinks WITHOUT a primary key, the builder maps value rows to GEOADD coordinates and requires the `latitude` option (the name/template of the latitude column). If `latitude` is missing from the WITH options the build fails with this SinkError::Config.

Source

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

            }
            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."))
                    })?;
                    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"
                        )));
                    }

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Add `latitude = '<lat-column>'` to the WITH options.
  2. Also add `longitude = '<lon-column>'`, which is checked immediately after.
  3. If your table actually has a primary key, the code instead expects `member` + `key_format` — align the options with the table shape.

Example fix

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

Strategy: validation

Validate before calling

if value_type == "geospatial" && !has_pk {
    for opt in ["latitude", "longitude"] {
        if !with_options.contains_key(opt) {
            return Err(format!("Redis geospatial sink without PK requires `{}`", opt));
        }
    }
}

Try / catch

match result {
    Err(e) if e.to_string().contains("`latitude`") => {
        eprintln!("Add `latitude`/`longitude` column options: {}", e);
    }
    other => other?,
}

Prevention

When it happens

Trigger: Creating a Redis geospatial sink on a table without a primary key but omitting `latitude = '<column-name>'` from the WITH options.

Common situations: Users assume geospatial sinks auto-detect lat/lon columns; instead the option names `latitude` and `longitude` must be given explicitly in the WITH clause.

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