risingwavelabs/risingwave · error · SinkError::Config

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

Error message

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

What it means

For a Redis geospatial sink, the `longitude` 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 from the schema or has any other data type (e.g. int, decimal), since Redis GEOADD requires numeric coordinates.

Source

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

                    })?;
                    let lat_name = self.format_desc.options.get(LAT_NAME).ok_or_else(|| {
                        SinkError::Config(anyhow!(
                            "Cannot find `{LAT_NAME}`, please set it or use JSON or set `{REDIS_VALUE_TYPE}` to `{REDIS_VALUE_TYPE_STRING}`"
                        ))
                    })?;
                    let member_name = self.format_desc.options.get(MEMBER_NAME).ok_or_else(|| {
                        SinkError::Config(anyhow!(
                            "Cannot find `{MEMBER_NAME}`, please set it or use JSON or set `{REDIS_VALUE_TYPE}` to `{REDIS_VALUE_TYPE_STRING}`"
                        ))
                    })?;
                    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

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Change the source/table column type to DOUBLE (float64), REAL (float32), or VARCHAR
  2. Or point the `longitude` option at an existing numeric/varchar column of an allowed type
  3. Verify the option value exactly matches a column name in the sink schema

Example fix

-- before: longitude = 'lon_deg' where lon_deg is INTEGER
ALTER TABLE t ADD COLUMN lon DOUBLE;  -- or cast via an upstream mv
-- after
... encode template (redis_value_type = 'geospatial', longitude = 'lon', ...)
Defensive patterns

Strategy: type-guard

Validate before calling

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

Try / catch

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

Prevention

When it happens

Trigger: CREATE SINK with encode template, redis_value_type = 'geospatial', where the `longitude = '<col>'` option names a column that does not exist in the sink schema or is typed as something other than FLOAT64/FLOAT32/VARCHAR (src/connector/src/sink/redis.rs:389-399).

Common situations: Pointing `longitude` at an INTEGER or DECIMAL longitude column; referencing a column renamed after the sink config was written; a typo in the column name so the all_map lookup returns None.

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