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

  1. Ensure the initial solution set DataSet is non-null before creating the delta iteration.
  2. Verify both required inputs (solution set and workset) are set for the delta iteration.
  3. 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

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


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/10038e804ae5c8e4. Report an issue: GitHub.