{"record":{"id":"112bec645c9dd3c9","repo":"risingwavelabs/risingwave","slug":"field-field-is-not-allowed-to-be-altered-on-th-112bec","errorCode":null,"errorMessage":"Field '{field}' is not allowed to be altered on the fly for sink: {sink_name}","messagePattern":"Field '(.+?)' is not allowed to be altered on the fly for sink: (.+?)","errorType":"validation","errorClass":"ConnectorError","httpStatus":null,"severity":"error","filePath":"src/connector/src/with_options_test.rs","lineNumber":871,"sourceCode":"    let allowed_fields = if sink_name == JdbcSink::SINK_NAME {{\n        CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS.get(JdbcSink::SINK_NAME)\n    }} else {{\n        // Convert sink name to the type name key\n        let Some(type_name) = sink_properties::sink_name_to_config_type_name(sink_name) else {{\n            return Err(ConnectorError::from(anyhow::anyhow!(\n                \"Unknown sink connector: {{sink_name}}\"\n            )));\n        }};\n        SINK_ALLOW_ALTER_ON_FLY_FIELDS.get(type_name)\n    }};\n    let Some(allowed_fields) = allowed_fields else {{\n        return Err(ConnectorError::from(anyhow::anyhow!(\n            \"No allow_alter_on_fly fields registered for sink: {{sink_name}}\"\n        )));\n    }};\n    for field in fields {{\n        if !allowed_fields.contains(field) {{\n            return Err(ConnectorError::from(anyhow::anyhow!(\n                \"Field '{{field}}' is not allowed to be altered on the fly for sink: {{sink_name}}\"\n            )));\n        }}\n    }}\n    Ok(())\n}}\n\"#,\n        source_entries = source_entries,\n        sink_entries = sink_entries\n    )\n}\n","sourceCodeStart":853,"sourceCodeEnd":883,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/with_options_test.rs#L853-L883","documentation":"Generated-code guard for `ALTER SINK`: the requested field is absent from SINK_ALLOW_ALTER_ON_FLY_FIELDS (or the JdbcSink-specific list) for that sink connector, so altering it without recreating the sink is rejected. Generic whitelist check over the field name.","triggerScenarios":"Validating an ALTER on a sink field not present in SINK_ALLOW_ALTER_ON_FLY_FIELDS for the given sink type.","commonSituations":"Attempting to change immutable sink options (e.g. Kafka topic, JDBC table) live; field-name typo; trying schema evolution the sink does not support.","solutions":["Alter only fields in the sink's allow_alter_on_fly registry.","Recreate the sink with the desired configuration instead of altering it.","Fix field name casing/typos.","Register the field as alterable and regenerate if it should be supported."],"exampleFix":"// before\ncheck_sink_allow_alter_on_fly_fields(\"kafka\", &[\"topic\".into()])?;\n// after\nDROP SINK s;\nCREATE SINK s INTO kafka WITH (topic = 'new-topic');","handlingStrategy":"validation","validationCode":"fn can_alter_sink(sink: &str, field: &str) -> bool {\n    let allowed = if sink == JdbcSink::SINK_NAME {\n        CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS.get(JdbcSink::SINK_NAME)\n    } else {\n        sink_properties::sink_name_to_config_type_name(sink)\n            .and_then(|t| SINK_ALLOW_ALTER_ON_FLY_FIELDS.get(t))\n    };\n    allowed.map(|f| f.contains(&field.to_string())).unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match check_sink_allow_alter_on_fly_fields(sink, &fields) {\n    Err(e) => return Err(sql_error::unsupported(&format!(\"sink alter rejected: {e}\"))),\n    Ok(()) => proceed(),\n}","preventionTips":["Recreate sinks for immutable option changes","Check the sink's registered alterable fields before ALTER","Match field names exactly"],"tags":["sink","schema-change","field-validation"],"backgroundTag":"unsupported-operation","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}