apache/iceberg · error · UnsupportedOperationException
Cannot apply unknown modify-column change:
Error message
Cannot apply unknown modify-column change:
What it means
applyModifyColumn handles only the known ModifyColumn subtypes (rename, type, comment, position, etc.); any other ModifyColumn variant falls into the else branch and is rejected. This can surface when a new Flink ModifyColumn subtype is used with an older connector.
Solutions
- Upgrade iceberg-flink to a version supporting the specific ModifyColumn subtype
- Replace the unsupported modification with equivalent supported operations (e.g. drop + add, or separate rename/type/comment calls)
- Inspect change.toString() in the message to identify which subtype failed and adjust the DDL
Example fix
// before ALTER TABLE t MODIFY col NEWTYPE; // unsupported modify variant // after ALTER TABLE t DROP col; ALTER TABLE t ADD col NEWTYPE; // or use a supported MODIFY form (rename/type/comment)
Defensive patterns
Strategy: validation
Validate before calling
for (TableChange c : changes) {
if (c instanceof TableChange.ModifyColumn
&& !(c instanceof TableChange.ModifyColumnName
|| c instanceof TableChange.UpdateColumnType
|| c instanceof TableChange.ModifyColumnComment
|| c instanceof TableChange.ModifyColumnPosition)) {
throw new IllegalArgumentException("Unsupported ModifyColumn: " + c);
}
} Try / catch
try {
FlinkAlterTableUtil.applySchemaChanges(table, changes);
} catch (UnsupportedOperationException e) {
// fall back to drop+add or direct UpdateSchema for the unsupported modify
} Prevention
- Use only documented MODIFY COLUMN forms (rename/type/comment/position)
- Match Flink and Iceberg connector versions
- Translate unsupported modify variants before applying
When it happens
Trigger: Calling applySchemaChanges with a TableChange.ModifyColumn subtype not implemented in this util version (e.g. a newly added Flink subtype), or a bare/unknown ModifyColumn instance.
Common situations: Flink version upgrade introducing new column-modification semantics; generic DDL executors passing through all ModifyColumn variants.
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
- Cannot apply unknown modify-column-position change:
- Altering partition keys is not supported yet.
- Cannot apply unknown table change:
- Cannot create the table with 'connector'='iceberg' table…
- Cannot create the table with 'connector'='iceberg' table…
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/40c919d3d6eb10e7.
Report an issue: GitHub.
Appendix: source
Thrown at flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java:227
applyModifyColumnPosition(pendingUpdate, modifyPosition);
} else if (modifyColumn instanceof TableChange.ModifyPhysicalColumnType) {
TableChange.ModifyPhysicalColumnType modifyType =
(TableChange.ModifyPhysicalColumnType) modifyColumn;
Type type = FlinkSchemaUtil.convert(modifyType.getNewType().getLogicalType());
String columnName = modifyType.getOldColumn().getName();
pendingUpdate.updateColumn(columnName, type.asPrimitiveType());
if (modifyType.getNewColumn().getDataType().getLogicalType().isNullable()) {
pendingUpdate.makeColumnOptional(columnName);
} else {
pendingUpdate.requireColumn(columnName);
}
} else if (modifyColumn instanceof TableChange.ModifyColumnComment) {
TableChange.ModifyColumnComment modifyComment =
(TableChange.ModifyColumnComment) modifyColumn;
pendingUpdate.updateColumnDoc(
modifyComment.getOldColumn().getName(), modifyComment.getNewComment());
} else {
throw new UnsupportedOperationException(
"Cannot apply unknown modify-column change: " + modifyColumn);
}
}
private static void applyModifyColumnPosition(
UpdateSchema pendingUpdate, TableChange.ModifyColumnPosition modifyColumnPosition) {
TableChange.ColumnPosition newPosition = modifyColumnPosition.getNewPosition();
if (newPosition instanceof TableChange.First) {
pendingUpdate.moveFirst(modifyColumnPosition.getOldColumn().getName());
} else if (newPosition instanceof TableChange.After) {
TableChange.After after = (TableChange.After) newPosition;
pendingUpdate.moveAfter(modifyColumnPosition.getOldColumn().getName(), after.column());
} else {
throw new UnsupportedOperationException(
"Cannot apply unknown modify-column-position change: " + modifyColumnPosition);
}
}
View on GitHub (pinned to 86d9c8fc54)