apache/flink · error · InvalidProgramException
The delta iteration {} has no initial solution set.
Error message
The delta iteration {} has no initial solution set. What it means
Thrown by CollectionExecutor.executeDeltaIteration() when iteration.getInitialSolutionSet() returns null. Delta iterations require two inputs: an initial solution set and an initial workset. A null initial solution set means the first input of the delta iteration was never connected. This is an InvalidProgramException.
Source
Thrown at flink-core/src/main/java/org/apache/flink/api/common/operators/CollectionExecutor.java:410
for (Map.Entry<String, Aggregator<?>> e : aggregators.entrySet()) {
previousAggregates.put(e.getKey(), e.getValue().getAggregate());
e.getValue().reset();
}
}
previousAggregates.clear();
aggregators.clear();
return currentResult;
}
@SuppressWarnings("unchecked")
private <T> List<T> executeDeltaIteration(DeltaIterationBase<?, ?> iteration, JobInfo jobInfo)
throws Exception {
Operator<?> solutionInput = iteration.getInitialSolutionSet();
Operator<?> worksetInput = iteration.getInitialWorkset();
if (solutionInput == null) {
throw new InvalidProgramException(
"The delta iteration " + iteration.getName() + " has no initial solution set.");
}
if (worksetInput == null) {
throw new InvalidProgramException(
"The delta iteration " + iteration.getName() + " has no initial workset.");
}
if (iteration.getSolutionSetDelta() == null) {
throw new InvalidProgramException(
"The iteration "
+ iteration.getName()
+ " has no solution set delta defined (is not closed).");
}
if (iteration.getNextWorkset() == null) {
throw new InvalidProgramException(
"The iteration "
+ iteration.getName()
+ " has no workset defined (is not closed).");
}View on GitHub (pinned to 2f3c205e92)
Solutions
- Ensure the initial solution set DataSet is non-null before creating the delta iteration.
- Verify both required inputs (solution set and workset) are set for the delta iteration.
- Print the execution plan to confirm the delta iteration's solution set input is wired.
Example fix
// before — initialSolutionSet is null
DataSet<Tuple2<Long, Long>> solutionSet = null;
DeltaIteration<Tuple2<Long,Long>, Tuple2<Long,Long>> iter =
solutionSet.iterateDelta(workset, 100, 0);
// after
DataSet<Tuple2<Long, Long>> solutionSet = env.fromElements(Tuple2.of(1L, 1L));
DeltaIteration<Tuple2<Long,Long>, Tuple2<Long,Long>> iter =
solutionSet.iterateDelta(workset, 100, 0); Defensive patterns
Strategy: validation
Validate before calling
// Ensure initial solution set is non-null
if (solutionSet == null) {
throw new IllegalStateException("Initial solution set for delta iteration is null");
}
DeltaIteration<S,W> iter = solutionSet.iterateDelta(workset, 100, 0); Prevention
- Verify both the solution set and workset DataSets are non-null before calling iterateDelta().
- Print the plan to confirm the delta iteration has both inputs wired.
- Remember delta iterations require two input DataSets (solution set + workset).
When it happens
Trigger: A DeltaIterationBase is created but getInitialSolutionSet() returns null because the solution set input was never wired. In the high-level API this occurs when the DataSet passed to iterateDelta(initialSolutionSet, ...) or the equivalent builder is null.
Common situations: The initial solution set DataSet variable is null due to an upstream transformation returning null, a conditional assignment that was skipped, or an incorrect variable reference. Delta iterations are less commonly used than bulk iterations, so developers may be less familiar with the two-input requirement.
Related errors
- The delta iteration {} has no initial workset.
- The iteration {} has no input (initial partial solution).
- The iteration {} has no solution set delta defined (is not c
- The iteration {} has no workset defined (is not closed).
- The data sink {} has no input.
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/10038e804ae5c8e4.
Report an issue: GitHub.