{"record":{"id":"d4a9febb831bc14f","repo":"apache/iceberg","slug":"incremental-scan-is-not-supported-d4a9fe","errorCode":null,"errorMessage":"Incremental scan is not supported","messagePattern":"Incremental scan is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/BaseTableScan.java","lineNumber":34,"sourceCode":" * specific language governing permissions and limitations\n * under the License.\n */\npackage org.apache.iceberg;\n\nimport org.apache.iceberg.io.CloseableIterable;\nimport org.apache.iceberg.util.TableScanUtil;\n\n/** Base class for {@link TableScan} implementations. */\nabstract class BaseTableScan extends SnapshotScan<TableScan, FileScanTask, CombinedScanTask>\n    implements TableScan {\n\n  protected BaseTableScan(Table table, Schema schema, TableScanContext context) {\n    super(table, schema, context);\n  }\n\n  @Override\n  public TableScan appendsBetween(long fromSnapshotId, long toSnapshotId) {\n    throw new UnsupportedOperationException(\"Incremental scan is not supported\");\n  }\n\n  @Override\n  public TableScan appendsAfter(long fromSnapshotId) {\n    throw new UnsupportedOperationException(\"Incremental scan is not supported\");\n  }\n\n  @Override\n  public CloseableIterable<CombinedScanTask> planTasks() {\n    CloseableIterable<FileScanTask> fileScanTasks = planFiles();\n    CloseableIterable<FileScanTask> splitFiles =\n        TableScanUtil.splitFiles(fileScanTasks, targetSplitSize());\n    return TableScanUtil.planTasks(\n        splitFiles, targetSplitSize(), splitLookback(), splitOpenFileCost());\n  }\n}\n","sourceCodeStart":16,"sourceCodeEnd":51,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/BaseTableScan.java#L16-L51","documentation":"BaseTableScan is the legacy pre-v1 TableScan implementation that only supports full snapshot scans. appendsBetween (incremental scan between two snapshot IDs) is intentionally unimplemented and always throws UnsupportedOperationException; use the modern TableScan implementations (DataTableScan) instead.","triggerScenarios":"Calling scan.appendsBetween(fromId, toId) on a table whose scan class resolves to BaseTableScan — i.e. legacy code paths or tables/providers that don't produce incremental-capable scans.","commonSituations":"Custom catalogs returning BaseTableScan; very old Iceberg migrations; code using the deprecated TableScan API against a scan implementation lacking incremental support; streaming readers pointed at unsupported scan types.","solutions":["Use the table's standard scan (table.newScan(), i.e. DataTableScan) which supports appendsBetween/appendsAfter","Ensure the catalog returns DataTableScan/KeyedTableScan rather than the legacy BaseTableScan","Replace incremental logic with explicit snapshot-difference reading (compare manifests between snapshots) if incremental scan isn't available","Upgrade Iceberg — BaseTableScan-based paths were superseded by the v1.1+ TableScan implementations"],"exampleFix":"// before\nTableScan scan = new BaseTableScan(table, schema, context);\nscan.appendsBetween(fromId, toId);\n// after\nTableScan scan = table.newScan();\nCloseableIterable<ScanTask> tasks = scan.appendsBetween(fromId, toId).planTasks();","handlingStrategy":"fallback","validationCode":"TableScan scan = table.newScan();\nif (scan.getClass().getSimpleName().equals(\"BaseTableScan\")) {\n  throw new IllegalStateException(\"legacy scan lacks incremental support\");\n}","typeGuard":null,"tryCatchPattern":"try { return scan.appendsBetween(from, to); } catch (UnsupportedOperationException e) { return fullScanFallback(); }","preventionTips":["Always create scans via table.newScan()","Ensure custom catalogs return DataTableScan","Prefer engine-native Iceberg sources for incremental/streaming reads"],"tags":["iceberg","unsupported-operation","incremental-scan"],"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"}