prestodb/presto · error · PrestoException
ICEBERG_FILESYSTEM_ERROR
ICEBERG_FILESYSTEM_ERROR
Error message
failed to write statistics file
What it means
writeTableStatistics commits statistics (Puffin blob) metadata to the Iceberg table via a transaction commit; if an IOException occurs during that commit, it logs a warning and throws PrestoException(ICEBERG_FILESYSTEM_ERROR, "failed to write statistics file"). It signals the underlying filesystem/storage failed while persisting table statistics.
Source
Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/TableStatisticsMaker.java:402
.flatMap(generator -> Optional.ofNullable(generator.generate(key, value, icebergTable, snapshot, typeManager)))
.ifPresent(writer::add);
});
writer.finish();
icebergTable.updateStatistics().setStatistics(
snapshot.snapshotId(),
new GenericStatisticsFile(
snapshot.snapshotId(),
path,
writer.fileSize(),
writer.footerSize(),
writer.writtenBlobsMetadata().stream()
.map(GenericBlobMetadata::from)
.collect(toImmutableList())))
.commit();
}
catch (IOException e) {
log.warn(e, "failed to write table statistics file");
throw new PrestoException(ICEBERG_FILESYSTEM_ERROR, "failed to write statistics file", e);
}
}
}
@FunctionalInterface
private interface PuffinBlobGenerator
{
@Nullable
Blob generate(ColumnStatisticMetadata metadata, Block value, Table icebergTable, Snapshot snapshot, TypeManager typeManager);
}
@FunctionalInterface
private interface PuffinBlobReader
{
/**
* Reads the stats from the blob and then updates the stats builder argument.
*/
void read(BlobMetadata metadata, ByteBuffer blob, ColumnStatistics.Builder stats, Table icebergTable, TypeManager typeManager);View on GitHub (pinned to 55bb57d202)
Solutions
- Check the wrapped IOException cause for the underlying filesystem error (permissions, throttling, connectivity)
- Retry the ANALYZE command — statistics writes are idempotent at the metadata level for transient failures
- Verify write permissions on the table location and that credentials are valid and not expiring mid-operation
- Check storage health/quota (S3 bucket policy, HDFS space, GCS quotas) before re-running
Defensive patterns
Strategy: retry
Validate before calling
// Verify write access to the table location before running ANALYZE // e.g. attempt a small test write/delete to the table directory, and check credential expiry
Try / catch
try { /* ANALYZE table */ } catch (PrestoException e) {
if (e.getErrorCode().getName().equals("ICEBERG_FILESYSTEM_ERROR")) {
// inspect e.getCause() (IOException) — retry transient failures, fix perms otherwise
} else { throw e; }
} Prevention
- Ensure valid, long-enough-lived credentials for the table's storage location
- Monitor object-store throttling (S3 503s) and retry ANALYZE during quiet periods
- Check quotas and available space on the target filesystem
- Retry ANALYZE on transient I/O failures — the write is safe to repeat
When it happens
Trigger: ANALYZE table (statistics write path) where the commit to the object store/filesystem fails — I/O error, permission denied, throttling, or network interruption to S3/HDFS/GCS during blob or metadata file write.
Common situations: S3 throttling (503 SlowDown) or expired credentials mid-write; HDFS NameNode unavailability; quota exceeded on the storage; transient network partitions during ANALYZE.
Related errors
- ICEBERG_FILESYSTEM_ERROR
- Could not save table statistics data
- Could not save table statistics data
- HIVE_FILESYSTEM_ERROR
- HIVE_FILESYSTEM_ERROR
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/3ab75184c8099792.
Report an issue: GitHub.