{"record":{"id":"10038e804ae5c8e4","repo":"apache/flink","slug":"the-delta-iteration-has-no-initial-solution-set","errorCode":null,"errorMessage":"The delta iteration {} has no initial solution set.","messagePattern":"The delta iteration (.+?) has no initial solution set\\.","errorType":"validation","errorClass":"InvalidProgramException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/common/operators/CollectionExecutor.java","lineNumber":410,"sourceCode":"            for (Map.Entry<String, Aggregator<?>> e : aggregators.entrySet()) {\n                previousAggregates.put(e.getKey(), e.getValue().getAggregate());\n                e.getValue().reset();\n            }\n        }\n\n        previousAggregates.clear();\n        aggregators.clear();\n\n        return currentResult;\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    private <T> List<T> executeDeltaIteration(DeltaIterationBase<?, ?> iteration, JobInfo jobInfo)\n            throws Exception {\n        Operator<?> solutionInput = iteration.getInitialSolutionSet();\n        Operator<?> worksetInput = iteration.getInitialWorkset();\n        if (solutionInput == null) {\n            throw new InvalidProgramException(\n                    \"The delta iteration \" + iteration.getName() + \" has no initial solution set.\");\n        }\n        if (worksetInput == null) {\n            throw new InvalidProgramException(\n                    \"The delta iteration \" + iteration.getName() + \" has no initial workset.\");\n        }\n        if (iteration.getSolutionSetDelta() == null) {\n            throw new InvalidProgramException(\n                    \"The iteration \"\n                            + iteration.getName()\n                            + \" has no solution set delta defined (is not closed).\");\n        }\n        if (iteration.getNextWorkset() == null) {\n            throw new InvalidProgramException(\n                    \"The iteration \"\n                            + iteration.getName()\n                            + \" has no workset defined (is not closed).\");\n        }","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/common/operators/CollectionExecutor.java#L392-L428","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before — initialSolutionSet is null\nDataSet<Tuple2<Long, Long>> solutionSet = null;\nDeltaIteration<Tuple2<Long,Long>, Tuple2<Long,Long>> iter =\n    solutionSet.iterateDelta(workset, 100, 0);\n// after\nDataSet<Tuple2<Long, Long>> solutionSet = env.fromElements(Tuple2.of(1L, 1L));\nDeltaIteration<Tuple2<Long,Long>, Tuple2<Long,Long>> iter =\n    solutionSet.iterateDelta(workset, 100, 0);","handlingStrategy":"validation","validationCode":"// Ensure initial solution set is non-null\nif (solutionSet == null) {\n    throw new IllegalStateException(\"Initial solution set for delta iteration is null\");\n}\nDeltaIteration<S,W> iter = solutionSet.iterateDelta(workset, 100, 0);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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)."],"tags":["iteration","delta-iteration","plan-validation","collection-executor","flink-core"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}