{"record":{"id":"83355308d806258b","repo":"apache/iceberg","slug":"unsupported-changelog-scan-task-type-task-getcl-833553","errorCode":null,"errorMessage":"Unsupported changelog scan task type: ${task.getClass().getName()}","messagePattern":"Unsupported changelog scan task type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/source/ChangelogRowReader.java","lineNumber":110,"sourceCode":"    metadataRow.update(0, UTF8String.fromString(task.operation().name()));\n    metadataRow.update(1, task.changeOrdinal());\n    metadataRow.update(2, task.commitSnapshotId());\n\n    return metadataRow;\n  }\n\n  private CloseableIterable<InternalRow> openChangelogScanTask(ChangelogScanTask task) {\n    if (task instanceof AddedRowsScanTask) {\n      return openAddedRowsScanTask((AddedRowsScanTask) task);\n\n    } else if (task instanceof DeletedRowsScanTask) {\n      throw new UnsupportedOperationException(\"Deleted rows scan task is not supported yet\");\n\n    } else if (task instanceof DeletedDataFileScanTask) {\n      return openDeletedDataFileScanTask((DeletedDataFileScanTask) task);\n\n    } else {\n      throw new IllegalArgumentException(\n          \"Unsupported changelog scan task type: \" + task.getClass().getName());\n    }\n  }\n\n  CloseableIterable<InternalRow> openAddedRowsScanTask(AddedRowsScanTask task) {\n    String filePath = task.file().location();\n    SparkDeleteFilter deletes = new SparkDeleteFilter(filePath, task.deletes(), counter(), true);\n    return deletes.filter(rows(task, deletes.requiredSchema()));\n  }\n\n  private CloseableIterable<InternalRow> openDeletedDataFileScanTask(DeletedDataFileScanTask task) {\n    String filePath = task.file().location();\n    SparkDeleteFilter deletes =\n        new SparkDeleteFilter(filePath, task.existingDeletes(), counter(), true);\n    return deletes.filter(rows(task, deletes.requiredSchema()));\n  }\n\n  private CloseableIterable<InternalRow> rows(ContentScanTask<DataFile> task, Schema readSchema) {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/source/ChangelogRowReader.java#L92-L128","documentation":"ChangelogRowReader throws IllegalArgumentException when a ChangelogScanTask instance is none of the three supported types (AddedRowsScanTask, DeletedRowsScanTask, DeletedDataFileScanTask). This indicates the scan planner produced a task type the row reader cannot handle, typically due to version skew.","triggerScenarios":"An unrecognized ChangelogScanTask subclass from a newer/older Iceberg runtime reaches openChangelogScanTask during changelog streaming.","commonSituations":"Mixing Iceberg jar versions (planner from one version, reader from another); custom scan task implementations injected via extensions.","solutions":["Ensure a single consistent Iceberg Spark runtime version on the classpath","Check for shaded/conflicting iceberg jars in the Spark session","Verify no custom ChangelogScanTask implementations are registered"],"exampleFix":"// before\n// mixed iceberg-spark-runtime 4.1 and iceberg-core 4.2 jars\n// after\n// single matching runtime\nimplementation(\"org.apache.iceberg:iceberg-spark-runtime-4.2_2.13:<same-version-everywhere>\")","handlingStrategy":"try-catch","validationCode":"if (!(task instanceof AddedRowsScanTask || task instanceof DeletedRowsScanTask || task instanceof DeletedDataFileScanTask)) { throw before processing }","typeGuard":"boolean isKnownChangelogTask(ChangelogScanTask t) { return t instanceof AddedRowsScanTask || t instanceof DeletedRowsScanTask || t instanceof DeletedDataFileScanTask; }","tryCatchPattern":null,"preventionTips":["Use exactly one Iceberg runtime version across the classpath","Check for shaded duplicate iceberg jars","Avoid custom ChangelogScanTask implementations with the stock reader"],"tags":["spark","streaming","changelog","task-type"],"backgroundTag":"invalid-enum-value","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"}