{"record":{"id":"cd8b213db224657c","repo":"apache/iceberg","slug":"unsupported-split-change-s","errorCode":null,"errorMessage":"Unsupported split change: %s","messagePattern":"Unsupported split change: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/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/v1.20/flink/src/main/java/org/apache/iceberg/flink/source/reader/IcebergSourceSplitReader.java#L91-L127","documentation":"IcebergSourceSplitReader.handleSplitsChanges only supports SplitsAddition; any other SplitsChange type (e.g., Splits Removal) throws UnsupportedOperationException. The Iceberg split reader never processes split removals.","triggerScenarios":"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.","commonSituations":"Custom enumerator emitting removals; connector bug when splits are added back after failover; running with incompatible connector versions.","solutions":["Use the built-in Iceberg enumerator/reader pair; do not mix custom split-removal logic with IcebergSourceSplitReader.","Verify enumerator and reader come from the same connector version (no mixed jars).","If removals are required, subclass the split reader and handle the change type before delegating additions."],"exampleFix":"// before\nreader.handleSplitsChanges(new SplitsRemoval<>(splits));\n// after\nreader.handleSplitsChanges(new SplitsAddition<>(splitsToAdd));","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"static boolean isAddition(SplitsChange<IcebergSourceSplit> change) {\n  return change instanceof SplitsAddition;\n}\n// call only if (isAddition(change)) reader.handleSplitsChanges(change);","tryCatchPattern":null,"preventionTips":["Only send SplitsAddition to IcebergSourceSplitReader","Use the stock enumerator/reader pair without custom removal logic","Keep reader and enumerator on the same connector version"],"tags":["flink","source-reader","unsupported-operation","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"}