prestodb/presto · error · PrestoException
ICEBERG_INCOMPATIBLE_VERSION
ICEBERG_INCOMPATIBLE_VERSION
Error message
Cannot read Iceberg manifest files for table format version %d (max supported: %d). Upgrade Presto to read this table.
What it means
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.
Source
Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/ManifestsTable.java:109
public ConnectorTableMetadata getTableMetadata()
{
return tableMetadata;
}
@Override
public ConnectorPageSource pageSource(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)
{
if (!snapshotId.isPresent()) {
return new FixedPageSource(ImmutableList.of());
}
return new FixedPageSource(buildPages(tableMetadata, icebergTable, snapshotId.get()));
}
private static List<Page> buildPages(ConnectorTableMetadata tableMetadata, Table icebergTable, long snapshotId)
{
int formatVersion = ((org.apache.iceberg.BaseTable) icebergTable).operations().current().formatVersion();
if (formatVersion > MAX_FORMAT_VERSION_FOR_METADATA_TABLES) {
throw new PrestoException(ICEBERG_INCOMPATIBLE_VERSION,
format("Cannot read Iceberg manifest files for table format version %d (max supported: %d). Upgrade Presto to read this table.",
formatVersion, MAX_FORMAT_VERSION_FOR_METADATA_TABLES));
}
PageListBuilder pagesBuilder = PageListBuilder.forTable(tableMetadata);
Snapshot snapshot = icebergTable.snapshot(snapshotId);
if (snapshot == null) {
throw new PrestoException(ICEBERG_INVALID_METADATA, format("Snapshot ID [%s] does not exist for table: %s", snapshotId, icebergTable));
}
Map<Integer, PartitionSpec> partitionSpecsById = icebergTable.specs();
snapshot.allManifests(icebergTable.io()).forEach(file -> {
pagesBuilder.beginRow();
pagesBuilder.appendVarchar(file.path());
pagesBuilder.appendBigint(file.length());
pagesBuilder.appendInteger(file.partitionSpecId());View on GitHub (pinned to 55bb57d202)
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.
Example fix
// before (Spark) — upgraded table beyond Presto support
ALTER TABLE catalog.db.t SET TBLPROPERTIES ('format-version'='3');
// after — keep compatible with current Presto
ALTER TABLE catalog.db.t SET TBLPROPERTIES ('format-version'='2'); Defensive patterns
Strategy: validation
Validate before calling
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
Try / catch
try {
execute("SELECT * FROM \"catalog.db.t$manifests\"");
} catch (PrestoException e) {
if ("ICEBERG_INCOMPATIBLE_VERSION".equals(e.getErrorCode().getName())) {
// fall back to Spark/Iceberg API for this metadata table
} else {
throw e;
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- ICEBERG_INVALID_FORMAT_VERSION
- ICEBERG_INVALID_METADATA
- Not a Hive table:
- Unsupported bucket function type
- GENERIC_INTERNAL_ERROR
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/71adc352d5954692.
Report an issue: GitHub.