{"record":{"id":"2b9ee31b3a1adec7","repo":"risingwavelabs/risingwave","slug":"alter-table-is-not-supported-for-iceberg-table","errorCode":null,"errorMessage":"ALTER TABLE {} is not supported for iceberg table without auto schema change sink: {}.{}","messagePattern":"ALTER TABLE (.+?) is not supported for iceberg table without auto schema change sink: (.+?)\\.(.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/frontend/src/handler/mod.rs","lineNumber":1738,"sourceCode":"                name,\n                has_auto_refresh_schema_sink,\n            )?;\n        }\n    }\n\n    Ok(())\n}\n\nfn check_ban_alter_table_operation_for_iceberg_engine_table(\n    operation: &AlterTableOperation,\n    schema_name: &str,\n    table_name: &ObjectName,\n    has_auto_refresh_schema_sink: bool,\n) -> Result<()> {\n    match operation {\n        AlterTableOperation::AddColumn { .. } => {\n            if !has_auto_refresh_schema_sink {\n                bail!(\n                    \"ALTER TABLE {} is not supported for iceberg table without auto schema change sink: {}.{}\",\n                    operation,\n                    schema_name,\n                    table_name\n                );\n            }\n        }\n        AlterTableOperation::DropColumn { .. } => {\n            if !has_auto_refresh_schema_sink {\n                bail!(\n                    \"ALTER TABLE {} is not supported for iceberg table without auto schema change sink: {}.{}\",\n                    operation,\n                    schema_name,\n                    table_name\n                );\n            }\n        }\n        AlterTableOperation::RenameColumn { .. }","sourceCodeStart":1720,"sourceCodeEnd":1756,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/handler/mod.rs#L1720-L1756","documentation":"ALTER TABLE ADD COLUMN on an Iceberg source table is only allowed when the table's sink supports automatic schema-change refresh. Without such a sink (`has_auto_refresh_schema_sink == false`), adding a column cannot propagate the schema change to Iceberg, so the frontend rejects the operation.","triggerScenarios":"Executing `ALTER TABLE <iceberg_table> ADD COLUMN ...` on a table backed by an Iceberg sink that was not created with auto schema-change support (e.g. missing the auto-refresh-schema sink option).","commonSituations":"Iceberg sink created before auto schema change was available or without the required sink option; schema evolution attempted manually on a legacy Iceberg table.","solutions":["Recreate the Iceberg sink with auto schema-change support enabled (auto refresh schema sink option), then retry ALTER TABLE ADD COLUMN.","Evolve the schema on the Iceberg side (or via the connector) instead of RisingWave ALTER TABLE.","Drop and recreate the table/sink with the new schema and backfill if schema evolution is essential."],"exampleFix":"// before\nCREATE SINK s FROM t WITH (connector = 'iceberg', ...); -- no auto schema change\nALTER TABLE t ADD COLUMN c INT;\n// after\nCREATE SINK s FROM t WITH (connector = 'iceberg', auto_refresh_schema = true, ...);\nALTER TABLE t ADD COLUMN c INT;","handlingStrategy":"validation","validationCode":"-- Confirm the iceberg sink supports auto schema change before ADD COLUMN\nSELECT * FROM rw_catalog.rw_sinks\nWHERE sink_from_relation_name = 't';\n-- verify the sink properties include auto schema-change refresh","typeGuard":"fn supports_auto_schema_change(sink_props: &SinkProps) -> bool {\n    sink_props.auto_refresh_schema == Some(true)\n}","tryCatchPattern":"match client.alter_table_add_column(table, col).await {\n    Err(e) if e.message().contains(\"without auto schema change sink\") => {\n        // recreate sink with auto_refresh_schema before retrying\n    }\n    other => other?,\n}","preventionTips":["Always create Iceberg sinks with auto schema-change enabled if schema evolution is planned.","Check sink properties before any column-level ALTER on Iceberg tables.","Restrict ALTER TABLE DDL on Iceberg tables to add/drop only."],"tags":["sql","iceberg","schema-change","unsupported-operation"],"backgroundTag":"operation-not-supported","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"}