apache/iceberg · error · UnsupportedOperationException

Unsupported split change: %s

Error message

Unsupported split change: %s

What it means

IcebergSourceSplitReader.handleSplitsChanges only supports SplitsAddition; any other SplitsChange type (e.g., Splits Removal) throws UnsupportedOperationException. The Iceberg split reader never processes split removals.

Source

Thrown at flink/v1.20/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

  1. Use the built-in Iceberg enumerator/reader pair; do not mix custom split-removal logic with IcebergSourceSplitReader.
  2. Verify enumerator and reader come from the same connector version (no mixed jars).
  3. If removals are required, subclass the split reader and handle the change type before delegating additions.

Example fix

// before
reader.handleSplitsChanges(new SplitsRemoval<>(splits));
// after
reader.handleSplitsChanges(new SplitsAddition<>(splitsToAdd));
Defensive patterns

Strategy: type-guard

Type guard

static boolean isAddition(SplitsChange<IcebergSourceSplit> change) {
  return change instanceof SplitsAddition;
}
// call only if (isAddition(change)) reader.handleSplitsChanges(change);

Prevention

When it happens

Trigger: The source reader receives a SplitsChange that is not a SplitsAddition — e.g., a SplitsRemoval produced by enumerator logic or a custom SourceReader/split assigner setup.

Common situations: Custom enumerator emitting removals; connector bug when splits are added back after failover; running with incompatible connector versions.

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