{"record":{"id":"60bae844ebf3443d","repo":"prestodb/presto","slug":"iceberg-cannot-open-split-60bae8","errorCode":"ICEBERG_CANNOT_OPEN_SPLIT","errorMessage":"unsupported task type ","messagePattern":"unsupported task type ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/changelog/ChangelogSplitSource.java","lineNumber":134,"sourceCode":"            closer.close();\n            // TODO: remove this after org.apache.iceberg.io.CloseableIterator'withClose\n            //  correct release resources holds by iterator.\n            fileScanTaskIterable = CloseableIterable.empty();\n            fileScanTaskIterator = CloseableIterator.empty();\n        }\n        catch (IOException e) {\n            throw new PrestoException(GENERIC_INTERNAL_ERROR, e);\n        }\n    }\n\n    private ConnectorSplit toIcebergSplit(ChangelogScanTask task)\n    {\n        if (task instanceof AddedRowsScanTask || task instanceof DeletedRowsScanTask || task instanceof DeletedDataFileScanTask) {\n            ContentScanTask<DataFile> scanTask = (ContentScanTask<DataFile>) task;\n            return splitFromContentScanTask(scanTask, task);\n        }\n        else {\n            throw new PrestoException(ICEBERG_CANNOT_OPEN_SPLIT, \"unsupported task type \" + task.getClass().getCanonicalName());\n        }\n    }\n\n    private IcebergSplit splitFromContentScanTask(ContentScanTask<DataFile> task, ChangelogScanTask changeTask)\n    {\n        PartitionSpec spec = task.spec();\n        Optional<PartitionData> partitionData = partitionDataFromStructLike(spec, task.file().partition());\n\n        return new IcebergSplit(\n                task.file().path().toString(),\n                task.start(),\n                task.length(),\n                FileFormat.fromIcebergFileFormat(task.file().format()),\n                ImmutableList.of(),\n                getPartitionKeys(task),\n                PartitionSpecParser.toJson(spec),\n                partitionData.map(PartitionData::toJson),\n                nodeSelectionStrategy,","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/changelog/ChangelogSplitSource.java#L116-L152","documentation":"ChangelogSplitSource.toIcebergSplit only converts AddedRowsScanTask, DeletedRowsScanTask and DeletedDataFileScanTask into IcebergSplits. Any other ChangelogScanTask subtype reaches the else branch and throws ICEBERG_CANNOT_OPEN_SPLIT with the task's canonical class name, indicating a task type this connector version cannot execute.","triggerScenarios":"A changelog planning phase emits a task class outside the three supported ones (e.g. a new Iceberg changelog task type introduced by a newer Iceberg library), then getNextBatch calls toIcebergSplit on it.","commonSituations":"Version mismatch between the Iceberg runtime library and the Presto Iceberg connector; custom task types from other Iceberg-integrated engines.","solutions":["Align the Presto Iceberg connector version with the Iceberg library version producing the tasks.","Check which task class appears in the message and whether an upgrade adds support for it.","If using changelog queries, restrict to table states that only produce the supported task types."],"exampleFix":"// before\nthrow new PrestoException(ICEBERG_CANNOT_OPEN_SPLIT, \"unsupported task type \" + task.getClass().getCanonicalName());\n// after (extend support)\nif (task instanceof MyNewScanTask) { return convert((MyNewScanTask) task); }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"boolean isSupportedChangelogTask(ChangelogScanTask t) {\n    return t instanceof AddedRowsScanTask || t instanceof DeletedRowsScanTask || t instanceof DeletedDataFileScanTask;\n}","tryCatchPattern":"try { splitSource.getNextBatch(1); } catch (PrestoException e) { if (e.getErrorCode() == ICEBERG_CANNOT_OPEN_SPLIT.toErrorCode() && e.getMessage().startsWith(\"unsupported task type\")) { /* upgrade connector */ } throw e; }","preventionTips":["Match Iceberg runtime version to the connector","Check the task class name in the message before upgrading","Smoke-test changelog queries on new Iceberg versions"],"tags":["iceberg","changelog","split","version-mismatch"],"backgroundTag":"unsupported-task-type","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}