apache/iceberg · warning
[For table {} with {}[{}] at {}]: Failed to plan data file r
Error message
[For table {} with {}[{}] at {}]: Failed to plan data file rewrite groups What it means
This warning is emitted by DataFileRewritePlanner.processElement when planning rewrite groups for a table fails. The planner refreshes the table, finds data files exceeding the rewrite threshold, and groups them into commits; any exception in that planning pipeline (table refresh, scanning, group construction) is caught, logged with table/task context, and does not fail the Flink job. The affected maintenance trigger cycle is simply skipped.
Source
Thrown at flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/DataFileRewritePlanner.java:184
taskName,
taskIndex,
ctx.timestamp(),
groups.size(),
groups);
plannedGroupsCounter.inc(groups.size());
for (RewriteFileGroup group : groups) {
LOG.info(
DataFileRewritePlanner.MESSAGE_PREFIX + "Emitting {}",
tableName,
taskName,
taskIndex,
ctx.timestamp(),
group);
out.collect(new PlannedGroup(table, groupsPerCommit, group, branch));
}
} catch (Exception e) {
LOG.warn(
DataFileRewritePlanner.MESSAGE_PREFIX + "Failed to plan data file rewrite groups",
tableName,
taskName,
taskIndex,
ctx.timestamp(),
e);
ctx.output(TaskResultAggregator.ERROR_STREAM, e);
errorCounter.inc();
}
}
@Override
public void close() throws Exception {
super.close();
tableLoader.close();
}
public static class PlannedGroup {View on GitHub (pinned to 86d9c8fc54)
Solutions
- Read the nested exception in the log; fix the underlying cause (catalog access, bad rewrite option, corrupted metadata)
- Verify catalog connectivity and credentials from the Flink TaskManager
- Validate the RewriteDataFiles options (e.g. min-input-files, partial-progress.enabled) passed to the maintenance action
- Re-trigger the maintenance job after the table is consistent; the planner is designed to retry on the next trigger
Defensive patterns
Strategy: retry
Try / catch
// Watch the ERROR_STREAM / logs; the planner already catches internally // e.g. consume side output when wiring the action job
Prevention
- Validate RewriteDataFiles options before submitting the maintenance action
- Ensure catalog connectivity and credentials from TaskManagers
- Retry on the next scheduled trigger; the planner is idempotent
- Avoid schema/spec evolution overlapping rewrite planning windows
When it happens
Trigger: Raised in DataFileRewritePlanner.processElement when rewritingGroups()/table operations throw — e.g. TableMetadata refresh failure against the catalog, snapshot scan errors while finding oversized/fragmented files, or exceptions building the rewrite groups with the configured options (partial progress, max-file-group-size, etc.).
Common situations: Catalog connectivity problems (Hive/REST/JDBC catalog timeout) during table refresh; corrupted or missing metadata/snapshot; invalid rewrite options passed via the action configuration; concurrent schema or partition-spec evolution during planning.
Understand the failure class
Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.
Related errors
- [For table {} with {}[{}] at {}]: Failed to plan data file r
- [For table {} with {}[{}] at {}]: Exception closing commit s
- [For table {} with {}[{}] at {}]: Exception processing {}
- [For table {} with {}[{}] at {}]: Exception closing commit s
- Rewrite data file error.
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/44c649bb6c807b5b.
Report an issue: GitHub.