prestodb/presto · error · UnsupportedOperationException
Unsupported task content: ${task.getContent()}
Error message
Unsupported task content: ${task.getContent()} What it means
Raised when a commit task written by a worker carries a TableCommitMetadata content type that this Presto/Iceberg version does not know how to finish. The finishWrite dispatcher only handles POSITION_DELETE and DATA content kinds; anything else (e.g. EQUALITY_DELETES) hits the default branch and throws UnsupportedOperationException.
Source
Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java:850
.toArray(Type[]::new);
handleFinishData(task, icebergTable, partitionSpec, partitionColumnTypes, appendFiles::appendFile, writtenFiles);
}
private void handleTask(CommitTaskData task, Table icebergTable, RowDelta rowDelta, ImmutableSet.Builder<String> writtenFiles, ImmutableSet.Builder<String> referencedDataFiles)
{
PartitionSpec partitionSpec = icebergTable.specs().get(task.getPartitionSpecId());
Type[] partitionColumnTypes = partitionSpec.fields().stream()
.map(field -> field.transform().getResultType(icebergTable.schema().findType(field.sourceId())))
.toArray(Type[]::new);
switch (task.getContent()) {
case POSITION_DELETES:
handleFinishPositionDeletes(task, partitionSpec, partitionColumnTypes, rowDelta, writtenFiles, referencedDataFiles);
break;
case DATA:
handleFinishData(task, icebergTable, partitionSpec, partitionColumnTypes, rowDelta::addRows, writtenFiles);
break;
default:
throw new UnsupportedOperationException("Unsupported task content: " + task.getContent());
}
}
private void handleFinishPositionDeletes(CommitTaskData task, PartitionSpec partitionSpec, Type[] partitionColumnTypes, RowDelta rowDelta, ImmutableSet.Builder<String> writtenFiles, ImmutableSet.Builder<String> referencedDataFiles)
{
FileMetadata.Builder deleteBuilder = FileMetadata.deleteFileBuilder(partitionSpec)
.withPath(task.getPath())
.withFormat(task.getFileFormat().toIceberg())
.ofPositionDeletes()
.withFileSizeInBytes(task.getFileSizeInBytes())
.withMetrics(task.getMetrics().metrics());
if (!partitionSpec.fields().isEmpty()) {
String partitionDataJson = task.getPartitionDataJson()
.orElseThrow(() -> new VerifyException("No partition data for partitioned table"));
deleteBuilder.withPartition(PartitionData.fromJson(partitionDataJson, partitionColumnTypes));
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Upgrade Presto to a version whose IcebergMetadata handles the task content type being produced.
- Ensure the table's UPDATE_MODE / delete strategy produces position deletes (merge-on-read with position deletes) rather than equality deletes.
- Avoid running row-level DML through an engine that doesn't support the delete-file type for the table's format version.
Example fix
// before -- equality-delete-producing engine commits tasks Presto cannot finish -- after SET SESSION iceberg.update_mode = 'merge-on-read'; -- use supported position-delete path, or upgrade Presto
Defensive patterns
Strategy: validation
Validate before calling
// confirm engine support before DML SELECT format_version FROM "t$properties"; -- ensure supported delete strategy SELECT value FROM "t$properties" WHERE key = 'write.delete.mode';
Try / catch
try { dml(...); }
catch (UnsupportedOperationException e) { /* upgrade connector or use position-delete-producing mode */ } Prevention
- Pin all engines that write to the table to compatible versions
- Configure tables to produce position deletes, not equality deletes
- Upgrade Presto before enabling newer Iceberg delete kinds
When it happens
Trigger: finishWrite processes CommitTaskData whose getContent() is neither DATA nor POSITION_DELETE — typically a table whose write plan produced equality delete files, or a mixed engine/version deployment writing new delete kinds the reader doesn't support.
Common situations: Reading/committing a table written by a newer engine that emits equality deletes; a Presto version too old to handle the delete-file kind produced during row-level DML.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/1038ffd5a21c0fc5.
Report an issue: GitHub.