{"record":{"id":"ebd5b9e82ab6aee4","repo":"risingwavelabs/risingwave","slug":"only-addcolumns-schema-change-is-supported-for-red","errorCode":null,"errorMessage":"Only AddColumns schema change is supported for Redshift sink","messagePattern":"Only AddColumns schema change is supported for Redshift sink","errorType":"validation","errorClass":"SinkError::Coordinator","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/snowflake_redshift/redshift.rs","lineNumber":709,"sourceCode":"                \"Manifest file written to S3 for sink id {} at epoch {}\",\n                self.sink_id,\n                epoch\n            );\n        }\n        Ok(())\n    }\n\n    async fn commit_schema_change(\n        &mut self,\n        _epoch: u64,\n        schema_change: PbSinkSchemaChange,\n    ) -> Result<()> {\n        use risingwave_pb::stream_plan::sink_schema_change::PbOp as SinkSchemaChangeOp;\n        let schema_change_op = schema_change\n            .op\n            .ok_or_else(|| SinkError::Coordinator(anyhow!(\"Invalid schema change operation\")))?;\n        let SinkSchemaChangeOp::AddColumns(add_columns) = schema_change_op else {\n            return Err(SinkError::Coordinator(anyhow!(\n                \"Only AddColumns schema change is supported for Redshift sink\"\n            )));\n        };\n        if let Some(shutdown_sender) = &self.shutdown_sender {\n            // Send shutdown signal to the periodic task before altering the table\n            shutdown_sender\n                .send(())\n                .map_err(|e| SinkError::Config(anyhow!(e)))?;\n        }\n        let sql = build_alter_add_column_sql(\n            self.config.schema.as_deref(),\n            &self.config.table,\n            &add_columns\n                .fields\n                .iter()\n                .map(|f| {\n                    let dt = DataType::from(f.data_type.as_ref().unwrap());\n                    Ok((f.name.clone(), convert_redshift_data_type(&dt)?))","sourceCodeStart":691,"sourceCodeEnd":727,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/snowflake_redshift/redshift.rs#L691-L727","documentation":"The Redshift sink only supports `AddColumns` schema evolution; any other operation (e.g. DropColumns, AlterType) is rejected with this Coordinator error. Redshift's sink implementation only implements the ALTER TABLE ... ADD COLUMN workflow. Other ops would require dropping or rewriting columns, which the implementation does not perform against the intermediate/target tables.","triggerScenarios":"Calling `commit_schema_change` on the Redshift sink with `schema_change.op` set to any variant other than `AddColumns`, e.g. `PbOp::DropColumns` after `ALTER TABLE ... DROP COLUMN` on the source table.","commonSituations":"Developers run `ALTER TABLE ... DROP COLUMN` or change a column type on a table materialized by a Redshift sink; a planner emits a new schema-change op type the sink doesn't know about.","solutions":["Avoid dropping/altering columns on tables feeding a Redshift sink; instead use `ALTER TABLE ... ADD COLUMN` only.","Recreate the sink (and downstream tables) if a column drop or type change is required.","Implement the missing op branch in `commit_schema_change` if your fork must support more ops."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let supported = matches!(change.op, Some(PbOp::AddColumns(_)));\nif !supported { return Err(anyhow!(\"Redshift sink supports only AddColumns\")); }","typeGuard":"fn is_add_columns(op: &Option<PbOp>) -> bool {\n    matches!(op, Some(PbOp::AddColumns(_)))\n}","tryCatchPattern":null,"preventionTips":["Restrict DDL on sinked tables to ADD COLUMN.","Document unsupported ops (DROP COLUMN, ALTER TYPE) for the Redshift sink in runbooks."],"tags":["rust","sink","redshift","schema-change","unsupported-operation"],"backgroundTag":"unsupported-operation","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"}