prestodb/presto · error · PrestoException

ICEBERG_BAD_DATA

ICEBERG_BAD_DATA

Error message

Error opening Iceberg split %s (offset=%s, length=%s): %s

What it means

When the Iceberg connector opens a data file for a split, any failure reading the underlying Parquet file is caught and rethrown as a PrestoException. If the underlying exception is a ParquetCorruptionException — i.e. the Parquet file itself is damaged or its schema/encoding does not match expectations — the connector wraps the message 'Error opening Iceberg split %s (offset=%s, length=%s): %s' with error code ICEBERG_BAD_DATA. This signals corrupted data rather than a transient infrastructure problem.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergPageSourceProvider.java:439

                    pageSource,
                    startRowPosition,
                    endRowPosition);
        }
        catch (Exception e) {
            try {
                if (dataSource != null) {
                    dataSource.close();
                }
            }
            catch (IOException ignored) {
            }
            if (e instanceof PrestoException) {
                throw (PrestoException) e;
            }
            String message = format("Error opening Iceberg split %s (offset=%s, length=%s): %s", path, start, length, e.getMessage());

            if (e instanceof ParquetCorruptionException) {
                throw new PrestoException(ICEBERG_BAD_DATA, message, e);
            }

            if (e instanceof BlockMissingException) {
                throw new PrestoException(ICEBERG_MISSING_DATA, message, e);
            }
            throw new PrestoException(ICEBERG_CANNOT_OPEN_SPLIT, message, e);
        }
    }

    public static Optional<org.apache.parquet.schema.Type> getColumnType(
            Map<Integer, org.apache.parquet.schema.Type> parquetIdToField,
            MessageType messageType,
            IcebergColumnHandle column)
    {
        if (isPushedDownSubfield(column)) {
            Subfield pushedDownSubfield = getPushedDownSubfield(column);
            List<String> encodedPath = nestedColumnPath(pushedDownSubfield).stream()
                    .map(AvroSchemaUtil::makeCompatibleName)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Validate the file with a Parquet tool (e.g. parquet-tools/meta) at the reported path/offset to confirm corruption, then rewrite the affected data files (e.g. via an Iceberg rewrite procedure or re-running the producing job).
  2. If files were written by a newer engine/writer, upgrade Presto to a version that supports the encodings used.
  3. Restore the corrupted files from backup/snapshot (Iceberg rollback or expiring snapshots and re-copying data).
  4. If corruption is spurious (e.g. bad storage node), fix the underlying storage and retry; ICEBERG_BAD_DATA is generally not fixed by retries alone.
Defensive patterns

Strategy: validation

Validate before calling

// Validate the data file before querying (outside Presto)
// parquet-tools meta s3a://bucket/table/data/file.parquet
// Or in the Iceberg metadata:
SELECT file_path, file_format FROM "table$files" WHERE file_format = 'PARQUET';

Try / catch

try {
    queryResults = execute("SELECT * FROM iceberg_table");
} catch (PrestoException e) {
    if ("ICEBERG_BAD_DATA".equals(e.getErrorCode().getName())) {
        // corrupted Parquet file: identify file from message, rewrite/restore it
        handleCorruptFile(e);
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Reading an Iceberg data split via createDataPageSource -> createParquetPageSource when the Parquet reader throws ParquetCorruptionException, e.g. malformed footer, invalid page encoding, checksum/column-chunk corruption, or schema mismatch in the .parquet file at the split's path/offset/length.

Common situations: Files corrupted by interrupted writes or faulty storage (HDFS/S3 truncation); files written by a newer writer using encodings this Presto version cannot decode; bit-rot or manual tampering with data files; a bad disk node serving corrupt bytes.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/378381725f1af2cb. Report an issue: GitHub.