apache/flink · error · InvalidProgramException
The delta iteration {} has no initial workset.
Error message
The delta iteration {} has no initial workset. What it means
Thrown by CollectionExecutor.executeDeltaIteration() when iteration.getInitialWorkset() returns null. Delta iterations need both an initial solution set (checked first) and an initial workset. If the workset input is null, the iteration has no work to process in the first step. This is an InvalidProgramException.
Source
Thrown at flink-core/src/main/java/org/apache/flink/api/common/operators/CollectionExecutor.java:414
}
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).");
}
List<T> solutionInputData = (List<T>) execute(solutionInput, jobInfo);
List<T> worksetInputData = (List<T>) execute(worksetInput, jobInfo);
View on GitHub (pinned to 2f3c205e92)
Solutions
- Ensure the initial workset DataSet is non-null before calling iterateDelta().
- Verify both the solution set and workset DataSets are properly sourced and non-null.
- Inspect the execution plan to confirm the workset input is wired.
Example fix
// before — workset is null DataSet<Tuple2<Long,Long>> workset = null; DeltaIteration<...> iter = solutionSet.iterateDelta(workset, 100, 0); // after DataSet<Tuple2<Long,Long>> workset = env.fromElements(Tuple2.of(1L, 1L)); DeltaIteration<...> iter = solutionSet.iterateDelta(workset, 100, 0);
Defensive patterns
Strategy: validation
Validate before calling
// Ensure initial workset is non-null
if (workset == null) {
throw new IllegalStateException("Initial workset for delta iteration is null");
}
DeltaIteration<S,W> iter = solutionSet.iterateDelta(workset, 100, 0); Prevention
- Verify the workset DataSet is non-null before calling iterateDelta().
- Check that the source producing the workset returns a valid DataSet.
- Print the plan to confirm the delta iteration's workset input is connected.
When it happens
Trigger: A DeltaIterationBase has its solution set connected but its workset is null. In the high-level API this occurs when the workset argument to iterateDelta(solutionSet, maxIterations, keys) is null because the source producing it was not properly initialized.
Common situations: The workset DataSet variable is null because the preceding transformation or source read returned null or was skipped. This is the symmetric counterpart to error 371 for the second input.
Related errors
- The delta iteration {} has no initial solution set.
- 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/2d9de972907cea40.
Report an issue: GitHub.