{"record":{"id":"46ce25cd902ce973","repo":"apache/iceberg","slug":"unsupported-table-change-modifywatermark-46ce25","errorCode":null,"errorMessage":"Unsupported table change: ModifyWatermark.","messagePattern":"Unsupported table change: ModifyWatermark\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java","lineNumber":137,"sourceCode":"   *\n   * @param pendingUpdate an uncommitted UpdateSchema operation to configure\n   * @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();","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java#L119-L155","documentation":"FlinkAlterTableUtil.applySchemaChanges does not support watermark table changes; TableChange.ModifyWatermark throws UnsupportedOperationException because Iceberg tables cannot store Flink watermark declarations.","triggerScenarios":"Executing 'ALTER TABLE ... MODIFY WATERMARK ...' (or applying a TableChange.ModifyWatermark) against an Iceberg table via the Flink catalog.","commonSituations":"Migrating table DDL workflows from Flink's filesystem/Kafka connectors (which support watermarks) to Iceberg.","solutions":["Remove the MODIFY WATERMARK clause; re-declare the watermark in the reading/streaming job instead","Restructure the pipeline so watermark generation is in the source/table scan, not the catalog table","Avoid automated DDL-sync tools that copy watermark changes to Iceberg tables"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"boolean hasModifyWatermark = java.util.Arrays.stream(changes)\n    .anyMatch(c -> c instanceof TableChange.ModifyWatermark);\nif (hasModifyWatermark) {\n  throw new IllegalArgumentException(\"Iceberg does not support MODIFY WATERMARK\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  FlinkAlterTableUtil.applySchemaChanges(update, changes);\n} catch (UnsupportedOperationException e) {\n  LOG.warn(\"Watermark changes are not applied to Iceberg tables: {}\", e.getMessage());\n}","preventionTips":["Keep watermark definitions in the streaming job, not the catalog table","Exclude watermark operations from cross-connector DDL migrations","Document that Iceberg schemas carry no watermark metadata"],"tags":["flink","ddl","unsupported-operation","watermark"],"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"}