apache/iceberg · error · UnsupportedOperationException

Unsupported table change: ModifyWatermark.

Error message

Unsupported table change: ModifyWatermark.

What it means

FlinkAlterTableUtil.applySchemaChanges does not support watermark table changes; TableChange.ModifyWatermark throws UnsupportedOperationException because Iceberg tables cannot store Flink watermark declarations.

Source

Thrown at flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java:137

   *
   * @param pendingUpdate an uncommitted UpdateSchema operation to configure
   * @param schemaChanges a list of Flink table changes
   */
  public static void applySchemaChanges(
      UpdateSchema pendingUpdate, List<TableChange> schemaChanges) {
    for (TableChange change : schemaChanges) {
      if (change instanceof TableChange.AddColumn) {
        applyAddColumn(pendingUpdate, (TableChange.AddColumn) change);
      } else if (change instanceof TableChange.ModifyColumn) {
        TableChange.ModifyColumn modifyColumn = (TableChange.ModifyColumn) change;
        applyModifyColumn(pendingUpdate, modifyColumn);
      } else if (change instanceof TableChange.DropColumn) {
        TableChange.DropColumn dropColumn = (TableChange.DropColumn) change;
        pendingUpdate.deleteColumn(dropColumn.getColumnName());
      } else if (change instanceof TableChange.AddWatermark) {
        throw new UnsupportedOperationException("Unsupported table change: AddWatermark.");
      } else if (change instanceof TableChange.ModifyWatermark) {
        throw new UnsupportedOperationException("Unsupported table change: ModifyWatermark.");
      } else if (change instanceof TableChange.DropWatermark) {
        throw new UnsupportedOperationException("Unsupported table change: DropWatermark.");
      } else if (change instanceof TableChange.AddUniqueConstraint) {
        TableChange.AddUniqueConstraint addPk = (TableChange.AddUniqueConstraint) change;
        applyUniqueConstraint(pendingUpdate, addPk.getConstraint());
      } else if (change instanceof TableChange.ModifyUniqueConstraint) {
        TableChange.ModifyUniqueConstraint modifyPk = (TableChange.ModifyUniqueConstraint) change;
        applyUniqueConstraint(pendingUpdate, modifyPk.getNewConstraint());
      } else if (change instanceof TableChange.DropConstraint) {
        throw new UnsupportedOperationException("Unsupported table change: DropConstraint.");
      } else {
        throw new UnsupportedOperationException("Cannot apply unknown table change: " + change);
      }
    }
  }

  private static void applyAddColumn(UpdateSchema pendingUpdate, TableChange.AddColumn addColumn) {
    Column flinkColumn = addColumn.getColumn();

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Remove the MODIFY WATERMARK clause; re-declare the watermark in the reading/streaming job instead
  2. Restructure the pipeline so watermark generation is in the source/table scan, not the catalog table
  3. Avoid automated DDL-sync tools that copy watermark changes to Iceberg tables
Defensive patterns

Strategy: validation

Validate before calling

boolean hasModifyWatermark = java.util.Arrays.stream(changes)
    .anyMatch(c -> c instanceof TableChange.ModifyWatermark);
if (hasModifyWatermark) {
  throw new IllegalArgumentException("Iceberg does not support MODIFY WATERMARK");
}

Try / catch

try {
  FlinkAlterTableUtil.applySchemaChanges(update, changes);
} catch (UnsupportedOperationException e) {
  LOG.warn("Watermark changes are not applied to Iceberg tables: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Executing 'ALTER TABLE ... MODIFY WATERMARK ...' (or applying a TableChange.ModifyWatermark) against an Iceberg table via the Flink catalog.

Common situations: Migrating table DDL workflows from Flink's filesystem/Kafka connectors (which support watermarks) to Iceberg.

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 apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/46ce25cd902ce973. Report an issue: GitHub.