apache/iceberg · error · UnsupportedOperationException

Unsupported table change: DropWatermark.

Error message

Unsupported table change: DropWatermark.

What it means

Guard in FlinkAlterTableUtil.applySchemaChanges: a DropWatermark change reached the Flink-to-Iceberg schema translation. Iceberg has no watermark concept in its schema, so the change is rejected rather than dropped silently.

Source

Thrown at flink/v2.2/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 no stored watermark to drop
  2. Filter out watermark changes before passing TableChange objects to Iceberg DDL execution
  3. Update schema-sync tooling to skip watermark operations for Iceberg catalogs

Example fix

// before
changes.add(TableChange.dropWatermark());
table.updateSchema(); // via applySchemaChanges -> throws
// after
List<TableChange> icebergChanges = changes.stream()
    .filter(c -> !(c instanceof TableChange.DropWatermark))
    .collect(Collectors.toList());
Defensive patterns

Strategy: validation

Validate before calling

boolean hasDropWatermark = java.util.Arrays.stream(changes)
    .anyMatch(c -> c instanceof TableChange.DropWatermark);
if (hasDropWatermark) {
  throw new IllegalArgumentException("Nothing to drop: Iceberg tables never store watermarks");
}

Try / catch

try {
  FlinkAlterTableUtil.applySchemaChanges(update, changes);
} catch (UnsupportedOperationException e) {
  LOG.warn("DROP WATERMARK is a no-op for Iceberg and was skipped: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Executing 'ALTER TABLE ... DROP WATERMARK' (or applying a TableChange.DropWatermark) against an Iceberg table through the Flink catalog.

Common situations: Cleanup DDL scripts shared across table types hitting Iceberg tables; schema-sync tooling attempting to drop watermarks.

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/5244b128a01366bc. Report an issue: GitHub.