prestodb/presto · error · PrestoException

ICEBERG_CANNOT_OPEN_SPLIT

ICEBERG_CANNOT_OPEN_SPLIT

Error message

unsupported task type 

What it means

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.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/changelog/ChangelogSplitSource.java:134

            closer.close();
            // TODO: remove this after org.apache.iceberg.io.CloseableIterator'withClose
            //  correct release resources holds by iterator.
            fileScanTaskIterable = CloseableIterable.empty();
            fileScanTaskIterator = CloseableIterator.empty();
        }
        catch (IOException e) {
            throw new PrestoException(GENERIC_INTERNAL_ERROR, e);
        }
    }

    private ConnectorSplit toIcebergSplit(ChangelogScanTask task)
    {
        if (task instanceof AddedRowsScanTask || task instanceof DeletedRowsScanTask || task instanceof DeletedDataFileScanTask) {
            ContentScanTask<DataFile> scanTask = (ContentScanTask<DataFile>) task;
            return splitFromContentScanTask(scanTask, task);
        }
        else {
            throw new PrestoException(ICEBERG_CANNOT_OPEN_SPLIT, "unsupported task type " + task.getClass().getCanonicalName());
        }
    }

    private IcebergSplit splitFromContentScanTask(ContentScanTask<DataFile> task, ChangelogScanTask changeTask)
    {
        PartitionSpec spec = task.spec();
        Optional<PartitionData> partitionData = partitionDataFromStructLike(spec, task.file().partition());

        return new IcebergSplit(
                task.file().path().toString(),
                task.start(),
                task.length(),
                FileFormat.fromIcebergFileFormat(task.file().format()),
                ImmutableList.of(),
                getPartitionKeys(task),
                PartitionSpecParser.toJson(spec),
                partitionData.map(PartitionData::toJson),
                nodeSelectionStrategy,

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Align the Presto Iceberg connector version with the Iceberg library version producing the tasks.
  2. Check which task class appears in the message and whether an upgrade adds support for it.
  3. If using changelog queries, restrict to table states that only produce the supported task types.

Example fix

// before
throw new PrestoException(ICEBERG_CANNOT_OPEN_SPLIT, "unsupported task type " + task.getClass().getCanonicalName());
// after (extend support)
if (task instanceof MyNewScanTask) { return convert((MyNewScanTask) task); }
Defensive patterns

Strategy: try-catch

Type guard

boolean isSupportedChangelogTask(ChangelogScanTask t) {
    return t instanceof AddedRowsScanTask || t instanceof DeletedRowsScanTask || t instanceof DeletedDataFileScanTask;
}

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

Common situations: Version mismatch between the Iceberg runtime library and the Presto Iceberg connector; custom task types from other Iceberg-integrated engines.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/60bae844ebf3443d. Report an issue: GitHub.