{"record":{"id":"e54718e4a1f3dd24","repo":"apache/iceberg","slug":"unsupported-split-change-s-e54718","errorCode":null,"errorMessage":"Unsupported split change: %s","messagePattern":"Unsupported split change: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/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.2/flink/src/main/java/org/apache/iceberg/flink/source/reader/IcebergSourceSplitReader.java#L91-L127","documentation":"IcebergSourceSplitReader only supports SplitsAddition when receiving split changes from the Flink Source framework. Any other SplitsChange type (e.g. SplitsRemoval) throws UnsupportedOperationException because the reader does not implement split removal semantics.","triggerScenarios":"The Flink source reader framework delivers a SplitsRemoval or other non-addition SplitsChange to handleSplitsChanges — typically when the enumerator emits removals (e.g. due to rescaling or split assignment changes).","commonSituations":"Custom enumerator implementations emitting removals; Flink rescaling with custom split handling; framework behavior changes across Flink versions triggering removal events the reader cannot handle.","solutions":["Upgrade the Iceberg Flink connector to a version whose split reader handles the change type","Ensure a custom enumerator only emits SplitsAddition to this reader","Check Flink version compatibility with the connector version","File/inspect an Iceberg issue if removals come from the stock enumerator"],"exampleFix":"// before (custom enumerator)\nenumeratorContext.sendSplitRequest();\n// ensure only additions are sent:\ncontext.signalNoMoreElement(); // avoid emitting SplitsRemoval\n// after: use stock IcebergEnumerator which only adds splits","handlingStrategy":"try-catch","validationCode":"// guard before delivering changes to the reader\nif (!(change instanceof SplitsAddition)) {\n  throw new IllegalArgumentException(\"Iceberg split reader only accepts SplitsAddition, got: \" + change.getClass());\n}","typeGuard":"static boolean isSupportedChange(SplitsChange<IcebergSourceSplit> c) {\n  return c instanceof SplitsAddition;\n}","tryCatchPattern":"try {\n  splitReader.handleSplitsChanges(change);\n} catch (UnsupportedOperationException e) {\n  LOG.error(\"Split reader cannot handle {} — check enumerator only emits additions\", change.getClass(), e);\n  throw e; // do not swallow; reader state would diverge from enumerator\n}","preventionTips":["Use the stock IcebergEnumerator, which only emits SplitsAddition","If writing a custom enumerator, never emit SplitsRemoval/SplitsReplacement toward this reader","Keep Flink and Iceberg connector versions compatible"],"tags":["flink","unsupported-operation","source-reader","splits"],"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"}