{"record":{"id":"71adc352d5954692","repo":"prestodb/presto","slug":"iceberg-incompatible-version-71adc3","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/ManifestsTable.java","lineNumber":109,"sourceCode":"    public ConnectorTableMetadata getTableMetadata()\n    {\n        return tableMetadata;\n    }\n\n    @Override\n    public ConnectorPageSource pageSource(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)\n    {\n        if (!snapshotId.isPresent()) {\n            return new FixedPageSource(ImmutableList.of());\n        }\n        return new FixedPageSource(buildPages(tableMetadata, icebergTable, snapshotId.get()));\n    }\n\n    private static List<Page> buildPages(ConnectorTableMetadata tableMetadata, Table icebergTable, long snapshotId)\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        PageListBuilder pagesBuilder = PageListBuilder.forTable(tableMetadata);\n\n        Snapshot snapshot = icebergTable.snapshot(snapshotId);\n        if (snapshot == null) {\n            throw new PrestoException(ICEBERG_INVALID_METADATA, format(\"Snapshot ID [%s] does not exist for table: %s\", snapshotId, icebergTable));\n        }\n\n        Map<Integer, PartitionSpec> partitionSpecsById = icebergTable.specs();\n\n        snapshot.allManifests(icebergTable.io()).forEach(file -> {\n            pagesBuilder.beginRow();\n            pagesBuilder.appendVarchar(file.path());\n            pagesBuilder.appendBigint(file.length());\n            pagesBuilder.appendInteger(file.partitionSpecId());","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/ManifestsTable.java#L91-L127","documentation":"The $manifests metadata table reads table manifests through Presto's Iceberg connector, which only supports Iceberg format versions up to MAX_FORMAT_VERSION_FOR_METADATA_TABLES. buildPages checks the table's current formatVersion from BaseTable operations; if the table was written with a newer format version than this Presto build supports, it throws PrestoException with ICEBERG_INCOMPATIBLE_VERSION instructing the user to upgrade Presto.","triggerScenarios":"Querying `SELECT * FROM \"catalog.schema.table$manifests\"` where the underlying table's metadata reports a formatVersion (e.g. 3) greater than the connector's max (e.g. 2) — typically a table created/upgraded by Spark 3.4+/Iceberg v2 writers supporting format version 3.","commonSituations":"A table migrated to Iceberg format v3 (deletion vectors, new manifest formats) while the Presto cluster still runs an older Iceberg connector; mixed-engine clusters where Spark upgraded the table but Presto wasn't upgraded in lockstep.","solutions":["Upgrade Presto to a version whose Iceberg connector supports the table's format version, then re-run the query.","Downgrade the table back to a supported format version (e.g. via Spark `ALTER TABLE ... SET TBLPROPERTIES ('format-version'='2')`) if the newer features are not required.","Read the manifest data out-of-band with a tool/engine that supports the format version (Spark/Iceberg APIs) instead of Presto's metadata table.","Pin the writing engine to format-version=2 while Presto support for v3 is unavailable in your deployment."],"exampleFix":"// before (Spark) — upgraded table beyond Presto support\nALTER TABLE catalog.db.t SET TBLPROPERTIES ('format-version'='3');\n// after — keep compatible with current Presto\nALTER TABLE catalog.db.t SET TBLPROPERTIES ('format-version'='2');","handlingStrategy":"validation","validationCode":"SELECT format_version FROM \"catalog.schema.table$snapshots\" LIMIT 1; -- or check table properties; ensure it is <= the connector's supported max (e.g. 2) before querying $manifests","typeGuard":null,"tryCatchPattern":"try {\n    execute(\"SELECT * FROM \\\"catalog.db.t$manifests\\\"\");\n} catch (PrestoException e) {\n    if (\"ICEBERG_INCOMPATIBLE_VERSION\".equals(e.getErrorCode().getName())) {\n        // fall back to Spark/Iceberg API for this metadata table\n    } else {\n        throw e;\n    }\n}","preventionTips":["Pin format-version=2 on shared tables until all engines in the cluster support v3.","Upgrade Presto in lockstep whenever Spark/Iceberg writers bump the table format version.","Track Presto release notes for Iceberg format-version support before migrating tables.","Test metadata-table queries ($manifests, $files) in staging after any table format change."],"tags":["iceberg","version-compatibility","metadata-table","format-version"],"backgroundTag":"iceberg-format-version-unsupported","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"}