apache/iceberg · error · UnsupportedOperationException
Unsupported table change: AddWatermark.
Error message
Unsupported table change: AddWatermark.
What it means
applySchemaChanges translates Flink TableChange objects into Iceberg Schema updates via a pending update. Watermark changes are not supported by this Flink-to-Iceberg bridge, so AddWatermark throws UnsupportedOperationException unconditionally.
Source
Thrown at flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java:135
/**
* Applies a list of Flink table changes to an {@link UpdateSchema} operation.
*
* @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);
}
}
}
View on GitHub (pinned to 86d9c8fc54)
Solutions
- Remove the ADD WATERMARK clause; declare watermarks on the Flink source table/DDL view instead of the Iceberg table.
- Apply time-attribute/watermark logic in the Flink pipeline (event-time on source), not as a table-level change.
- Track Iceberg/Flink support for watermark table features and upgrade when available.
Example fix
// before ALTER TABLE iceberg_table ADD WATERMARK FOR rowtime AS rowtime - INTERVAL '5' SECOND; // after // define watermark in the Flink source DDL, not on the Iceberg table: CREATE TABLE kafka_src (... , WATERMARK FOR rowtime AS rowtime - INTERVAL '5' SECOND) ...
Defensive patterns
Strategy: validation
Validate before calling
if (changes.stream().anyMatch(c -> c instanceof TableChange.AddWatermark)) { throw new IllegalArgumentException('Watermark changes are not supported on Iceberg tables'); } Try / catch
try { catalog.alterTable(tableIdent, changes); } catch (UnsupportedOperationException e) { LOG.warn('Unsupported DDL on Iceberg table: {}', e.getMessage()); } Prevention
- Keep watermark declarations in Flink source DDL, not Iceberg table DDL
- Filter TableChange lists before passing to the Iceberg catalog
- Review Flink-to-Iceberg DDL compatibility matrices before migrating SQL scripts
When it happens
Trigger: Executing 'ALTER TABLE ... ADD WATERMARK' (Flink SQL watermark statement) against a table routed through the Iceberg catalog's alterTable path.
Common situations: Flink SQL DDL that declares watermarks on Iceberg tables; SQL clients generating watermark table features that the Iceberg spec/catalog layer does not carry.
Related errors
- Unsupported table change: ModifyWatermark.
- Unsupported table change: DropWatermark.
- Unsupported table change: DropConstraint.
- Unsupported table change: AddWatermark.
- Unsupported table change: ModifyWatermark.
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/ef1d9f78295dd406.
Report an issue: GitHub.