{"record":{"id":"c9848f3dc7a8c32b","repo":"prestodb/presto","slug":"iceberg-incompatible-version-c9848f","errorCode":"ICEBERG_INCOMPATIBLE_VERSION","errorMessage":"Cannot read Iceberg manifest files for table format version %d (max supported: %d). Upgrade Presto to read this table.","messagePattern":"Cannot read Iceberg manifest files for table format version (.+?) \\(max supported: (.+?)\\)\\. Upgrade Presto to read this table\\.","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTable.java","lineNumber":180,"sourceCode":"    @Override\n    public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)\n    {\n        // TODO instead of cursor use pageSource method.\n        if (!snapshotId.isPresent()) {\n            return new InMemoryRecordSet(resultTypes, ImmutableList.of()).cursor();\n        }\n        TableScan tableScan = icebergTable.newScan()\n                .metricsReporter(new RuntimeStatsMetricsReporter(session.getRuntimeStats()))\n                .useSnapshot(snapshotId.get())\n                .includeColumnStats();\n        return buildRecordCursor(getPartitions(tableScan), icebergTable.spec().fields());\n    }\n\n    private Map<StructLikeWrapper, Partition> getPartitions(TableScan tableScan)\n    {\n        int formatVersion = ((org.apache.iceberg.BaseTable) icebergTable).operations().current().formatVersion();\n        if (formatVersion > MAX_FORMAT_VERSION_FOR_METADATA_TABLES) {\n            throw new PrestoException(ICEBERG_INCOMPATIBLE_VERSION,\n                    format(\"Cannot read Iceberg manifest files for table format version %d (max supported: %d). Upgrade Presto to read this table.\",\n                            formatVersion, MAX_FORMAT_VERSION_FOR_METADATA_TABLES));\n        }\n\n        try (CloseableIterable<FileScanTask> fileScanTasks = tableScan.planFiles()) {\n            Map<StructLikeWrapper, Partition> partitions = new HashMap<>();\n\n            for (FileScanTask fileScanTask : fileScanTasks) {\n                DataFile dataFile = fileScanTask.file();\n                Types.StructType structType = fileScanTask.spec().partitionType();\n                StructLike partitionStruct = dataFile.partition();\n                StructLikeWrapper partitionWrapper = StructLikeWrapper.forType(structType).set(partitionStruct);\n\n                if (!partitions.containsKey(partitionWrapper)) {\n                    Partition partition = new Partition(\n                            idToTypeMapping,\n                            nonPartitionPrimitiveColumns,\n                            partitionStruct,","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTable.java#L162-L198","documentation":"PartitionTable.getPartitions checks the table's Iceberg format version before reading manifests; versions above MAX_FORMAT_VERSION_FOR_METADATA_TABLES raise ICEBERG_INCOMPATIBLE_VERSION because this Presto build cannot parse the newer manifest format for the PARTITIONS metadata table.","triggerScenarios":"Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTable.java:180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Upgrade Presto to a release supporting the table's format version","Downgrade/rewrite the table to a supported format version if feasible"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}