{"record":{"id":"013dc8864f878809","repo":"apache/iceberg","slug":"unsupported-table-change-dropwatermark-013dc8","errorCode":null,"errorMessage":"Unsupported table change: DropWatermark.","messagePattern":"Unsupported table change: DropWatermark\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java","lineNumber":139,"sourceCode":"   * @param schemaChanges a list of Flink table changes\n   */\n  public static void applySchemaChanges(\n      UpdateSchema pendingUpdate, List<TableChange> schemaChanges) {\n    for (TableChange change : schemaChanges) {\n      if (change instanceof TableChange.AddColumn) {\n        applyAddColumn(pendingUpdate, (TableChange.AddColumn) change);\n      } else if (change instanceof TableChange.ModifyColumn) {\n        TableChange.ModifyColumn modifyColumn = (TableChange.ModifyColumn) change;\n        applyModifyColumn(pendingUpdate, modifyColumn);\n      } 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),","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java#L121-L157","documentation":"Guard in FlinkAlterTableUtil.applySchemaChanges: a DropWatermark table change was received while translating Flink ALTER TABLE changes to Iceberg UpdateSchema calls. Iceberg schemas do not model watermarks, so the change cannot be applied and is rejected.","triggerScenarios":"Executing 'ALTER TABLE ... DROP WATERMARK' through Flink SQL against a table resolved to the Iceberg catalog.","commonSituations":"Cleanup scripts that drop watermarks generically across tables of mixed engines/catalogs, hitting Iceberg tables.","solutions":["Remove the DROP WATERMARK statement for Iceberg tables — there is nothing to drop","Gate DDL scripts on catalog/table type before issuing watermark DDL"],"exampleFix":"-- before\nALTER TABLE iceberg_table DROP WATERMARK;\n-- after\n-- (removed; watermarks are not supported on Iceberg tables)","handlingStrategy":"try-catch","validationCode":"if (changes.stream().anyMatch(c -> c instanceof TableChange.DropWatermark)) {\n  throw new IllegalArgumentException(\"DROP WATERMARK is a no-op/unsupported on Iceberg tables\");\n}","typeGuard":"boolean isWatermarkChange(TableChange c) { return c instanceof TableChange.AddWatermark || c instanceof TableChange.ModifyWatermark || c instanceof TableChange.DropWatermark; }","tryCatchPattern":"try {\n  FlinkAlterTableUtil.applySchemaChanges(update, changes);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"DropWatermark\")) { /* skip silently or handle */ }\n  throw e;\n}","preventionTips":["Skip DROP WATERMARK statements when the target is an Iceberg table","Catalog-aware DDL scripts that branch on table type"],"tags":["flink","schema-change","watermark","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"}