apache/iceberg · error · UnsupportedOperationException
Unsupported split change: %s
Error message
Unsupported split change: %s
What it means
IcebergSourceSplitReader only supports SplitsAddition changes. If the SourceReader hands it any other SplitsChange subtype (e.g. SplitsRemoval), it throws UnsupportedOperationException naming the change class. This reflects that removals/redistribution are handled elsewhere in this reader implementation.
Source
Thrown at flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/reader/IcebergSourceSplitReader.java:109
}
if (currentReader.hasNext()) {
// Because Iterator#next() doesn't support checked exception,
// we need to wrap and unwrap the checked IOException with UncheckedIOException
try {
return currentReader.next();
} catch (UncheckedIOException e) {
throw e.getCause();
}
} else {
return finishSplit();
}
}
@Override
public void handleSplitsChanges(SplitsChange<IcebergSourceSplit> splitsChange) {
if (!(splitsChange instanceof SplitsAddition)) {
throw new UnsupportedOperationException(
String.format("Unsupported split change: %s", splitsChange.getClass()));
}
if (splitComparator != null) {
List<IcebergSourceSplit> newSplits = Lists.newArrayList(splitsChange.splits());
newSplits.sort(splitComparator);
LOG.info("Add {} splits to reader: {}", newSplits.size(), newSplits);
splits.addAll(newSplits);
} else {
LOG.info("Add {} splits to reader", splitsChange.splits().size());
splits.addAll(splitsChange.splits());
}
metrics.incrementAssignedSplits(splitsChange.splits().size());
metrics.incrementAssignedBytes(calculateBytes(splitsChange));
}
@Override
public void wakeUp() {View on GitHub (pinned to 86d9c8fc54)
Solutions
- Ensure the split enumerator only assigns new splits via SplitsAddition to this reader.
- Remove/return splits at the enumerator level rather than sending SplitsRemoval to readers.
- If you own a custom enumerator, filter out non-addition changes before assigning to IcebergSource readers.
- Check Flink connector version compatibility; upgrade iceberg-flink runtime to match your Flink version.
Example fix
// before reader.handleSplitsChanges(new SplitsRemoval<>(splits)); // after // do not send removals to IcebergSourceSplitReader; handle in enumerator // reader.handleSplitsChanges(new SplitsAddition<>(newSplits));
Defensive patterns
Strategy: type-guard
Validate before calling
if (splitsChange instanceof SplitsAddition) { reader.handleSplitsChanges(splitsChange); } else { /* handle removal/redistribution in enumerator */ } Type guard
boolean isAddition(SplitsChange<IcebergSourceSplit> c) { return c instanceof SplitsAddition; } Try / catch
try { reader.handleSplitsChanges(change); } catch (UnsupportedOperationException e) { LOG.warn('Non-addition split change rejected: {}', change.getClass()); } Prevention
- Only emit SplitsAddition from your enumerator to Iceberg readers
- Handle split removal at the enumerator/source-coordinator level
- Pin iceberg-flink version to your Flink version to avoid framework behavior mismatches
When it happens
Trigger: The enumerator sends a SplitsChange other than SplitsAddition (such as SplitsRemoval) to the reader via handleSplitsChanges, typically during split assignment changes, scaling down of readers, or custom enumerator implementations.
Common situations: Custom SourceEnumerator implementations that issue removal changes; upgrading Flink connectors and the framework emitting removal events; state redistribution after rescaling a job.
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
- Unsupported split change: %s
- Unsupported split change: {splitsChange.getClass()}
- Unsupported split change: %s
- Altering schema is not supported in the old alterTable API.
- Altering partition keys is not supported yet.
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/c8a4a30827601321.
Report an issue: GitHub.