{"record":{"id":"4cc0f0de3166205e","repo":"risingwavelabs/risingwave","slug":"unknown-fields-in-the-with-clause","errorCode":null,"errorMessage":"Unknown fields in the WITH clause: {:?}","messagePattern":"Unknown fields in the WITH clause: (.+?)","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/mod.rs","lineNumber":337,"sourceCode":"    // even if a connector-specific config does not declare them.\n    for key in [\n        CONNECTOR_TYPE_KEY,\n        SINK_TYPE_OPTION,\n        SINK_SNAPSHOT_OPTION,\n        SINK_USER_IGNORE_DELETE_OPTION,\n        SINK_USER_FORCE_APPEND_ONLY_OPTION,\n        SINK_USER_FORCE_COMPACTION,\n        SINK_USER_PRESERVE_ROW_LEVEL_CHANGES,\n        \"backfill_rate_limit\",\n        \"primary_key\",\n        \"sink_rate_limit\",\n    ] {\n        unknown_fields.remove(key);\n    }\n    if unknown_fields.is_empty() {\n        Ok(())\n    } else {\n        Err(SinkError::Config(anyhow!(\n            \"Unknown fields in the WITH clause: {:?}\",\n            unknown_fields\n        )))\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq)]\npub struct SinkParam {\n    pub sink_id: SinkId,\n    pub sink_name: String,\n    pub properties: BTreeMap<String, String>,\n    pub columns: Vec<ColumnDesc>,\n    /// User-defined primary key indices for upsert sink, if any.\n    pub downstream_pk: Option<Vec<usize>>,\n    pub sink_type: SinkType,\n    /// Whether to drop DELETE and convert UPDATE to INSERT in the sink executor.\n    pub ignore_delete: bool,\n    pub format_desc: Option<SinkFormatDesc>,","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/mod.rs#L319-L355","documentation":"`validate_sink_unknown_fields` checks sink WITH-clause properties against the known/supported keys for the chosen connector (removing recognized keys via `unknown_fields.remove(key)`); if any remain, they are listed in this Config error. It prevents silently ignoring misspelled or obsolete options.","triggerScenarios":"Calling `validate_sink_unknown_fields` with WITH properties containing keys not in the connector's known-field set — misspellings, deprecated options, or options belonging to a different connector.","commonSituations":"Typo'd WITH options like `primay_key`; copying sink options from another connector; options removed/renamed in a RisingWave upgrade.","solutions":["Remove or correct the unknown WITH options listed in the error message","Check the connector's documentation for valid option names in this version","Update deprecated option names to their current equivalents"],"exampleFix":"// before\nWITH (connector = 'kafka', primay_key = 'id')\n// after\nWITH (connector = 'kafka', primary_key = 'id')","handlingStrategy":"validation","validationCode":"let known: Vec<_> = spec_known_keys(connector);\nlet unknown: Vec<_> = props.keys().filter(|k| !known.contains(k)).collect();\nif !unknown.is_empty() {\n    return Err(anyhow!(\"Unknown fields in the WITH clause: {unknown:?}\"));\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = validate_sink_unknown_fields(connector, &props) {\n    // surface unknown keys to the user before retrying DDL\n    return Err(anyhow!(\"fix WITH options: {e}\"));\n}","preventionTips":["Check the connector's documented option list before writing the WITH clause","Spell-check option names; most failures are typos","Diff WITH options against the current version after upgrading RisingWave"],"tags":["rust","validation","sink","with-clause"],"backgroundTag":"schema-validation-failed","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"}