risingwavelabs/risingwave · error · SinkError::Config

`{LAT_NAME}` must be set to `float64` or `float32` or `varch

Error message

`{LAT_NAME}` must be set to `float64` or `float32` or `varchar`

What it means

For a Redis geospatial sink, the `latitude` option must point at a column whose type is float64, float32, or varchar. RedisSink::validate rejects the sink with this SinkError::Config when the referenced column is missing or has another type, because Redis GEOADD needs numeric latitude values.

Source

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

                    if let Some(lon_type) = all_map.get(lon_name)
                        && (lon_type == &DataType::Float64
                            || lon_type == &DataType::Float32
                            || lon_type == &DataType::Varchar)
                    {
                        // do nothing
                    } else {
                        return Err(SinkError::Config(anyhow!(
                            "`{LON_NAME}` must be set to `float64` or `float32` or `varchar`"
                        )));
                    }
                    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())

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Change the column type to DOUBLE (float64), REAL (float32), or VARCHAR
  2. Or point `latitude` at an existing column of an allowed type
  3. Verify the column name in the option matches the sink schema exactly

Example fix

-- before: latitude = 'lat_i' where lat_i is INTEGER
ALTER TABLE t ADD COLUMN lat DOUBLE;
-- after
... encode template (redis_value_type = 'geospatial', latitude = 'lat', ...)
Defensive patterns

Strategy: type-guard

Validate before calling

-- guard before CREATE SINK:
-- SELECT data_type FROM schema_of(t) WHERE name = options['latitude']
-- allowed: 'double precision', 'real', 'character varying'

Try / catch

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

Prevention

When it happens

Trigger: CREATE SINK with encode template, redis_value_type = 'geospatial', where the `latitude = '<col>'` option names a column not present in the schema or typed other than FLOAT64/FLOAT32/VARCHAR (src/connector/src/sink/redis.rs:400-410).

Common situations: Pointing `latitude` at an INTEGER/DECIMAL column; the latitude column dropped or renamed upstream; misspelling the column name so the schema lookup misses.

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