apache/iceberg · error · UnsupportedOperationException
Cannot apply unknown modify-column-position change:
Error message
Cannot apply unknown modify-column-position change:
What it means
Guard in FlinkAlterTableUtil.applyModifyColumnPosition: while processing a column-position change (FIRST/AFTER/...), the specific position kind did not match any known TableChange.ColumnPosition branch. The appended value is the modifyColumn change; it signals a new Flink position variant this utility does not yet translate.
Solutions
- Rewrite the DDL to express the position with AFTER (reference the preceding column) or FIRST
- Convert BEFORE X into AFTER (column preceding X) before applying changes
- Skip the repositioning change if column order is not critical
Example fix
// before ALTER TABLE t MODIFY COLUMN col BEFORE other_col; // after ALTER TABLE t MODIFY COLUMN col AFTER col_preceding_other_col;
Defensive patterns
Strategy: validation
Validate before calling
if (c instanceof TableChange.ModifyColumnPosition) {
TableChange.ColumnPosition pos = ((TableChange.ModifyColumnPosition) c).newPosition();
if (!(pos instanceof TableChange.First) && !(pos instanceof TableChange.After)) {
throw new IllegalArgumentException("Only FIRST/AFTER positions supported");
}
} Type guard
boolean isSupportedPosition(TableChange.ColumnPosition pos) {
return pos instanceof TableChange.First || pos instanceof TableChange.After;
} Try / catch
try {
FlinkAlterTableUtil.applySchemaChanges(table, changes);
} catch (UnsupportedOperationException e) {
// rewrite BEFORE into AFTER of the preceding column and retry
} Prevention
- Express column placement with FIRST or AFTER only
- Convert BEFORE clauses at the DDL-translation layer
- Avoid relying on column order where possible
When it happens
Trigger: A TableChange.ModifyColumnPosition (or AddColumn with position) whose new position is neither First nor After reaching applyModifyColumnPosition.
Common situations: DDL generators that emit `ALTER TABLE ... MODIFY col BEFORE other_col`; engines/tooling assuming Iceberg supports Before positioning via the Flink path.
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 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/58c30b47aced903d.
Report an issue: GitHub.
Appendix: source
Thrown at flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/util/FlinkAlterTableUtil.java:241
(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);
}
}
private static void applyUniqueConstraint(
UpdateSchema pendingUpdate, UniqueConstraint constraint) {
switch (constraint.getType()) {
case PRIMARY_KEY:
pendingUpdate.setIdentifierFields(constraint.getColumns());
break;
case UNIQUE_KEY:
throw new UnsupportedOperationException(
"Unsupported table change: setting unique key constraints.");
default:
throw new UnsupportedOperationException(
"Cannot apply unknown unique constraint: " + constraint.getType().name());
}
}View on GitHub (pinned to 86d9c8fc54)