{"record":{"id":"1038ffd5a21c0fc5","repo":"prestodb/presto","slug":"unsupported-task-content-task-getcontent","errorCode":null,"errorMessage":"Unsupported task content: ${task.getContent()}","messagePattern":"Unsupported task content: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java","lineNumber":850,"sourceCode":"                .toArray(Type[]::new);\n        handleFinishData(task, icebergTable, partitionSpec, partitionColumnTypes, appendFiles::appendFile, writtenFiles);\n    }\n\n    private void handleTask(CommitTaskData task, Table icebergTable, RowDelta rowDelta, ImmutableSet.Builder<String> writtenFiles, ImmutableSet.Builder<String> referencedDataFiles)\n    {\n        PartitionSpec partitionSpec = icebergTable.specs().get(task.getPartitionSpecId());\n        Type[] partitionColumnTypes = partitionSpec.fields().stream()\n                .map(field -> field.transform().getResultType(icebergTable.schema().findType(field.sourceId())))\n                .toArray(Type[]::new);\n        switch (task.getContent()) {\n            case POSITION_DELETES:\n                handleFinishPositionDeletes(task, partitionSpec, partitionColumnTypes, rowDelta, writtenFiles, referencedDataFiles);\n                break;\n            case DATA:\n                handleFinishData(task, icebergTable, partitionSpec, partitionColumnTypes, rowDelta::addRows, writtenFiles);\n                break;\n            default:\n                throw new UnsupportedOperationException(\"Unsupported task content: \" + task.getContent());\n        }\n    }\n\n    private void handleFinishPositionDeletes(CommitTaskData task, PartitionSpec partitionSpec, Type[] partitionColumnTypes, RowDelta rowDelta, ImmutableSet.Builder<String> writtenFiles, ImmutableSet.Builder<String> referencedDataFiles)\n    {\n        FileMetadata.Builder deleteBuilder = FileMetadata.deleteFileBuilder(partitionSpec)\n                .withPath(task.getPath())\n                .withFormat(task.getFileFormat().toIceberg())\n                .ofPositionDeletes()\n                .withFileSizeInBytes(task.getFileSizeInBytes())\n                .withMetrics(task.getMetrics().metrics());\n\n        if (!partitionSpec.fields().isEmpty()) {\n            String partitionDataJson = task.getPartitionDataJson()\n                    .orElseThrow(() -> new VerifyException(\"No partition data for partitioned table\"));\n            deleteBuilder.withPartition(PartitionData.fromJson(partitionDataJson, partitionColumnTypes));\n        }\n","sourceCodeStart":832,"sourceCodeEnd":868,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java#L832-L868","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n-- equality-delete-producing engine commits tasks Presto cannot finish\n-- after\nSET SESSION iceberg.update_mode = 'merge-on-read'; -- use supported position-delete path, or upgrade Presto","handlingStrategy":"validation","validationCode":"// confirm engine support before DML\nSELECT format_version FROM \"t$properties\"; -- ensure supported delete strategy\nSELECT value FROM \"t$properties\" WHERE key = 'write.delete.mode';","typeGuard":null,"tryCatchPattern":"try { dml(...); }\ncatch (UnsupportedOperationException e) { /* upgrade connector or use position-delete-producing mode */ }","preventionTips":["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"],"tags":["iceberg","unsupported-operation","delete-files","compatibility"],"backgroundTag":"unsupported-task-content-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"}