{"record":{"id":"dd01c79cc25eb931","repo":"risingwavelabs/risingwave","slug":"cannot-find-key-format-please-set-it","errorCode":null,"errorMessage":"Cannot find `{KEY_FORMAT}`,please set it.","messagePattern":"Cannot find `(.+?)`,please set it\\.","errorType":"validation","errorClass":"SinkError","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/formatter/mod.rs","lineNumber":340,"sourceCode":"                    Some(_) => KEY_FORMAT,\n                    None => VALUE_FORMAT,\n                };\n                let template = b.format_desc.options.get(option_name).ok_or_else(|| {\n                    SinkError::Config(anyhow!(\"Cannot find '{option_name}',please set it.\"))\n                })?;\n                Ok(TemplateEncoder::new_string(\n                    b.schema,\n                    pk_indices,\n                    template.clone(),\n                ))\n            }\n            REDIS_VALUE_TYPE_GEO => match pk_indices {\n                Some(_) => {\n                    let member_name = b.format_desc.options.get(MEMBER_NAME).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\"Cannot find `{MEMBER_NAME}`,please set it.\"))\n                    })?;\n                    let template = b.format_desc.options.get(KEY_FORMAT).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\"Cannot find `{KEY_FORMAT}`,please set it.\"))\n                    })?;\n                    TemplateEncoder::new_geo_key(\n                        b.schema,\n                        pk_indices,\n                        member_name,\n                        template.clone(),\n                    )\n                }\n                None => {\n                    let lat_name = b.format_desc.options.get(LAT_NAME).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\"Cannot find `{LAT_NAME}`, please set it.\"))\n                    })?;\n                    let lon_name = b.format_desc.options.get(LON_NAME).ok_or_else(|| {\n                        SinkError::Config(anyhow!(\"Cannot find `{LON_NAME}`,please set it.\"))\n                    })?;\n                    TemplateEncoder::new_geo_value(b.schema, pk_indices, lat_name, lon_name)\n                }\n            },","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/formatter/mod.rs#L322-L358","documentation":"For `redis_value_type = 'geospatial'` sinks with a primary key, after reading `member` the builder also requires the `key_format` option (the template for the Redis key holding the sorted set). A missing `key_format` aborts the sink build with this SinkError::Config.","triggerScenarios":"Creating a Redis geospatial sink with a primary key, providing `member` but not `key_format` in the WITH options.","commonSituations":"Users set `member` for geospatial sinks but forget that, like `string` type with a primary key, the key template `key_format` is mandatory.","solutions":["Add `key_format = '<template>'` to the WITH options.","Confirm `member` is also set, since it is read immediately before this check.","Use correct template placeholders for the key columns (e.g. `%s` for the primary key)."],"exampleFix":"// before\nWITH (redis_value_type='geospatial', member='%s');\n// after\nWITH (redis_value_type='geospatial', member='%s', key_format='%s:locations');","handlingStrategy":"validation","validationCode":"if value_type == \"geospatial\" && has_pk && !with_options.contains_key(\"key_format\") {\n    return Err(\"Redis geospatial sink with PK requires `key_format` option\".into());\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"`key_format`\") => {\n        eprintln!(\"Add `key_format = '<template>'` to WITH options: {}\", e);\n    }\n    other => other?,\n}","preventionTips":["Always define a key template for primary-key Redis sinks","Check option spelling: key_format, not key-format","Dry-run sink creation against a test cluster"],"tags":["redis","sink","geospatial","configuration"],"backgroundTag":"missing-required-option","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}