{"record":{"id":"2d9de972907cea40","repo":"apache/flink","slug":"the-delta-iteration-has-no-initial-workset","errorCode":null,"errorMessage":"The delta iteration {} has no initial workset.","messagePattern":"The delta iteration (.+?) has no initial workset\\.","errorType":"validation","errorClass":"InvalidProgramException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/common/operators/CollectionExecutor.java","lineNumber":414,"sourceCode":"        }\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        }\n\n        List<T> solutionInputData = (List<T>) execute(solutionInput, jobInfo);\n        List<T> worksetInputData = (List<T>) execute(worksetInput, jobInfo);\n","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/common/operators/CollectionExecutor.java#L396-L432","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before — workset is null\nDataSet<Tuple2<Long,Long>> workset = null;\nDeltaIteration<...> iter = solutionSet.iterateDelta(workset, 100, 0);\n// after\nDataSet<Tuple2<Long,Long>> workset = env.fromElements(Tuple2.of(1L, 1L));\nDeltaIteration<...> iter = solutionSet.iterateDelta(workset, 100, 0);","handlingStrategy":"validation","validationCode":"// Ensure initial workset is non-null\nif (workset == null) {\n    throw new IllegalStateException(\"Initial workset for delta iteration is null\");\n}\nDeltaIteration<S,W> iter = solutionSet.iterateDelta(workset, 100, 0);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"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"}