risingwavelabs/risingwave · error · SinkError::Coordinator

Only AddColumns schema change is supported for Redshift sink

Error message

Only AddColumns schema change is supported for Redshift sink

What it means

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.

Source

Thrown at src/connector/src/sink/snowflake_redshift/redshift.rs:709

                "Manifest file written to S3 for sink id {} at epoch {}",
                self.sink_id,
                epoch
            );
        }
        Ok(())
    }

    async fn commit_schema_change(
        &mut self,
        _epoch: u64,
        schema_change: PbSinkSchemaChange,
    ) -> Result<()> {
        use risingwave_pb::stream_plan::sink_schema_change::PbOp as SinkSchemaChangeOp;
        let schema_change_op = schema_change
            .op
            .ok_or_else(|| SinkError::Coordinator(anyhow!("Invalid schema change operation")))?;
        let SinkSchemaChangeOp::AddColumns(add_columns) = schema_change_op else {
            return Err(SinkError::Coordinator(anyhow!(
                "Only AddColumns schema change is supported for Redshift sink"
            )));
        };
        if let Some(shutdown_sender) = &self.shutdown_sender {
            // Send shutdown signal to the periodic task before altering the table
            shutdown_sender
                .send(())
                .map_err(|e| SinkError::Config(anyhow!(e)))?;
        }
        let sql = build_alter_add_column_sql(
            self.config.schema.as_deref(),
            &self.config.table,
            &add_columns
                .fields
                .iter()
                .map(|f| {
                    let dt = DataType::from(f.data_type.as_ref().unwrap());
                    Ok((f.name.clone(), convert_redshift_data_type(&dt)?))

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Avoid dropping/altering columns on tables feeding a Redshift sink; instead use `ALTER TABLE ... ADD COLUMN` only.
  2. Recreate the sink (and downstream tables) if a column drop or type change is required.
  3. Implement the missing op branch in `commit_schema_change` if your fork must support more ops.
Defensive patterns

Strategy: validation

Validate before calling

let supported = matches!(change.op, Some(PbOp::AddColumns(_)));
if !supported { return Err(anyhow!("Redshift sink supports only AddColumns")); }

Type guard

fn is_add_columns(op: &Option<PbOp>) -> bool {
    matches!(op, Some(PbOp::AddColumns(_)))
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/ebd5b9e82ab6aee4. Report an issue: GitHub.