apache/iceberg · error · UnsupportedOperationException

Unsupported table change: DropWatermark.

Error message

Unsupported table change: DropWatermark.

What it means

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.

Source

Thrown at flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java:139

   * @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();
    Preconditions.checkArgument(
        FlinkCompatibilityUtil.isPhysicalColumn(flinkColumn),

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Remove the DROP WATERMARK statement for Iceberg tables — there is nothing to drop
  2. Gate DDL scripts on catalog/table type before issuing watermark DDL

Example fix

-- before
ALTER TABLE iceberg_table DROP WATERMARK;
-- after
-- (removed; watermarks are not supported on Iceberg tables)
Defensive patterns

Strategy: try-catch

Validate before calling

if (changes.stream().anyMatch(c -> c instanceof TableChange.DropWatermark)) {
  throw new IllegalArgumentException("DROP WATERMARK is a no-op/unsupported on Iceberg tables");
}

Type guard

boolean isWatermarkChange(TableChange c) { return c instanceof TableChange.AddWatermark || c instanceof TableChange.ModifyWatermark || c instanceof TableChange.DropWatermark; }

Try / catch

try {
  FlinkAlterTableUtil.applySchemaChanges(update, changes);
} catch (UnsupportedOperationException e) {
  if (e.getMessage().contains("DropWatermark")) { /* skip silently or handle */ }
  throw e;
}

Prevention

When it happens

Trigger: Executing 'ALTER TABLE ... DROP WATERMARK' through Flink SQL against a table resolved to the Iceberg catalog.

Common situations: Cleanup scripts that drop watermarks generically across tables of mixed engines/catalogs, hitting Iceberg tables.

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/013dc8864f878809. Report an issue: GitHub.