{"record":{"id":"7bf7a9c6227fa9cf","repo":"apache/iceberg","slug":"cannot-apply-unknown-table-change-change","errorCode":null,"errorMessage":"Cannot apply unknown table change: {change}","messagePattern":"Cannot apply unknown table change: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java","lineNumber":149,"sourceCode":"      } else if (change instanceof TableChange.DropColumn) {\n        TableChange.DropColumn dropColumn = (TableChange.DropColumn) change;\n        pendingUpdate.deleteColumn(dropColumn.getColumnName());\n      } else if (change instanceof TableChange.AddWatermark) {\n        throw new UnsupportedOperationException(\"Unsupported table change: AddWatermark.\");\n      } else if (change instanceof TableChange.ModifyWatermark) {\n        throw new UnsupportedOperationException(\"Unsupported table change: ModifyWatermark.\");\n      } else if (change instanceof TableChange.DropWatermark) {\n        throw new UnsupportedOperationException(\"Unsupported table change: DropWatermark.\");\n      } else if (change instanceof TableChange.AddUniqueConstraint) {\n        TableChange.AddUniqueConstraint addPk = (TableChange.AddUniqueConstraint) change;\n        applyUniqueConstraint(pendingUpdate, addPk.getConstraint());\n      } else if (change instanceof TableChange.ModifyUniqueConstraint) {\n        TableChange.ModifyUniqueConstraint modifyPk = (TableChange.ModifyUniqueConstraint) change;\n        applyUniqueConstraint(pendingUpdate, modifyPk.getNewConstraint());\n      } else if (change instanceof TableChange.DropConstraint) {\n        throw new UnsupportedOperationException(\"Unsupported table change: DropConstraint.\");\n      } else {\n        throw new UnsupportedOperationException(\"Cannot apply unknown table change: \" + change);\n      }\n    }\n  }\n\n  private static void applyAddColumn(UpdateSchema pendingUpdate, TableChange.AddColumn addColumn) {\n    Column flinkColumn = addColumn.getColumn();\n    Preconditions.checkArgument(\n        FlinkCompatibilityUtil.isPhysicalColumn(flinkColumn),\n        \"Unsupported table change: Adding computed column %s.\",\n        flinkColumn.getName());\n\n    Type icebergType = FlinkSchemaUtil.convert(flinkColumn.getDataType().getLogicalType());\n\n    if (flinkColumn.getDataType().getLogicalType().isNullable()) {\n      pendingUpdate.addColumn(\n          flinkColumn.getName(), icebergType, flinkColumn.getComment().orElse(null));\n    } else {\n      pendingUpdate.addRequiredColumn(","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java#L131-L167","documentation":"Catch-all branch of applySchemaChanges: a TableChange subtype not recognized by the if/else chain is rejected with UnsupportedOperationException. It indicates the Flink change type has no Iceberg mapping in this connector version.","triggerScenarios":"Passing any TableChange other than Add/Modify/Drop column, watermark changes, unique/primary-key constraint changes, or SetOption/ResetOption to applySchemaChanges — typically a new Flink TableChange type introduced in a newer Flink version.","commonSituations":"Using a Flink 1.18+ or 2.x TableChange subtype with an Iceberg connector built for an older Flink API; custom catalog implementations forwarding unknown change objects.","solutions":["Upgrade the iceberg-flink connector to a version matching your Flink version so the change type is handled","Check which TableChange subtype you send (log/change.getClass().getName()) and replace it with a supported one","Apply the schema change via Iceberg's native API (UpdateSchema) instead of Flink DDL"],"exampleFix":"// before\nchange = TableChange.SomeNewChange(...); catalog.applyChange(tableId, change);\n// after\n// upgrade connector or use: table.updateSchema().<appropriate op>().commit();","handlingStrategy":"try-catch","validationCode":"// whitelist known change types before applying\nSet<Class<?>> supported = Set.of(TableChange.AddColumn.class, TableChange.ModifyColumn.class, TableChange.DropColumn.class, TableChange.SetOption.class, TableChange.ResetOption.class);","typeGuard":null,"tryCatchPattern":"try {\n  FlinkAlterTableUtil.applySchemaChanges(update, changes);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"Cannot apply unknown table change\")) {\n    log.error(\"Unmapped TableChange subtype: {}\", changes.getClass(), e);\n  }\n  throw e;\n}","preventionTips":["Keep Flink and iceberg-flink connector versions aligned so all TableChange subtypes are mapped","Log change.getClass().getName() when building DDL pipelines for easier diagnosis"],"tags":["flink","schema-change","fallback","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}