{"record":{"id":"c8a4a30827601321","repo":"apache/iceberg","slug":"unsupported-split-change-s-c8a4a3","errorCode":null,"errorMessage":"Unsupported split change: %s","messagePattern":"Unsupported split change: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/reader/IcebergSourceSplitReader.java","lineNumber":109,"sourceCode":"    }\n\n    if (currentReader.hasNext()) {\n      // Because Iterator#next() doesn't support checked exception,\n      // we need to wrap and unwrap the checked IOException with UncheckedIOException\n      try {\n        return currentReader.next();\n      } catch (UncheckedIOException e) {\n        throw e.getCause();\n      }\n    } else {\n      return finishSplit();\n    }\n  }\n\n  @Override\n  public void handleSplitsChanges(SplitsChange<IcebergSourceSplit> splitsChange) {\n    if (!(splitsChange instanceof SplitsAddition)) {\n      throw new UnsupportedOperationException(\n          String.format(\"Unsupported split change: %s\", splitsChange.getClass()));\n    }\n\n    if (splitComparator != null) {\n      List<IcebergSourceSplit> newSplits = Lists.newArrayList(splitsChange.splits());\n      newSplits.sort(splitComparator);\n      LOG.info(\"Add {} splits to reader: {}\", newSplits.size(), newSplits);\n      splits.addAll(newSplits);\n    } else {\n      LOG.info(\"Add {} splits to reader\", splitsChange.splits().size());\n      splits.addAll(splitsChange.splits());\n    }\n    metrics.incrementAssignedSplits(splitsChange.splits().size());\n    metrics.incrementAssignedBytes(calculateBytes(splitsChange));\n  }\n\n  @Override\n  public void wakeUp() {","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/reader/IcebergSourceSplitReader.java#L91-L127","documentation":"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.","triggerScenarios":"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.","commonSituations":"Custom SourceEnumerator implementations that issue removal changes; upgrading Flink connectors and the framework emitting removal events; state redistribution after rescaling a job.","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."],"exampleFix":"// before\nreader.handleSplitsChanges(new SplitsRemoval<>(splits));\n// after\n// do not send removals to IcebergSourceSplitReader; handle in enumerator\n// reader.handleSplitsChanges(new SplitsAddition<>(newSplits));","handlingStrategy":"type-guard","validationCode":"if (splitsChange instanceof SplitsAddition) { reader.handleSplitsChanges(splitsChange); } else { /* handle removal/redistribution in enumerator */ }","typeGuard":"boolean isAddition(SplitsChange<IcebergSourceSplit> c) { return c instanceof SplitsAddition; }","tryCatchPattern":"try { reader.handleSplitsChanges(change); } catch (UnsupportedOperationException e) { LOG.warn('Non-addition split change rejected: {}', change.getClass()); }","preventionTips":["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"],"tags":["flink","source-reader","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}