prestodb/presto · error · UncheckedIOException

Failed to scan changed partitions

Error message

Failed to scan changed partitions

What it means

This wraps an IOException raised while planning file scan tasks of an Iceberg table to collect changed partitions during materialized view incremental refresh. The failure is environmental/IO related, not logical — Presto could not read the table's manifest/plan files.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java:2525

                if (!APPEND.equals(operation) && !REPLACE.equals(operation)) {
                    return Optional.empty();
                }
            }
        }

        Set<StructLike> partitions = new HashSet<>();

        IncrementalAppendScan scan = icebergTable.newIncrementalAppendScan()
                .fromSnapshotExclusive(fromSnapshotId)
                .toSnapshot(toSnapshotId);

        try (CloseableIterable<FileScanTask> tasks = scan.planFiles()) {
            for (FileScanTask task : tasks) {
                partitions.add(task.file().partition());
            }
        }
        catch (IOException e) {
            throw new UncheckedIOException("Failed to scan changed partitions", e);
        }

        return Optional.of(ImmutableSet.copyOf(partitions));
    }

    private List<TupleDomain<String>> convertPartitionsToConstraints(
            ConnectorSession session,
            Table icebergTable,
            PartitionSpec spec,
            Set<StructLike> partitions)
    {
        List<TupleDomain<String>> constraints = new ArrayList<>();

        for (StructLike partition : partitions) {
            Map<String, Domain> domainMap = new HashMap<>();

            for (int i = 0; i < spec.fields().size(); i++) {
                PartitionField field = spec.fields().get(i);

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the wrapped IOException cause for the root storage error and fix access/permissions or network to the object store/HDFS.
  2. Verify table metadata and manifest files are intact; repair or re-register the table if files were deleted.
  3. Retry refresh after storage issues are resolved; run a full REFRESH MATERIALIZED VIEW as a fallback.
Defensive patterns

Strategy: retry

Validate before calling

// pre-check storage accessibility via a lightweight metadata read
SELECT 1 FROM catalog.schema."base$partitions" LIMIT 1;

Try / catch

try {
    refreshMv();
} catch (PrestoException e) {
    if (e.getCause() instanceof UncheckedIOException || e.getMessage().contains("Failed to scan changed partitions")) {
        retryWithBackoff(refreshMv, 3);
    } else throw e;
}

Prevention

When it happens

Trigger: Calling incremental refresh path where planFiles() on a table scan throws IOException — e.g. missing manifest files, permission errors, or storage (HDFS/S3) unavailability while reading manifests.

Common situations: Underlying manifest/data files deleted by compaction or expiry jobs, metastore/HDFS outages, S3 throttling or credentials issues, corrupted table metadata.

Related errors


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