{"record":{"id":"1b913cbec7327327","repo":"apache/beam","slug":"calling-getsideinput-with-unknown-view-1b913c","errorCode":null,"errorMessage":"calling getSideInput() with unknown view","messagePattern":"calling getSideInput\\(\\) with unknown view","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/SplittableParDoNaiveBounded.java","lineNumber":236,"sourceCode":"                    public PipelineOptions pipelineOptions() {\n                      return c.getPipelineOptions();\n                    }\n\n                    @Override\n                    public PaneInfo paneInfo(DoFn<InputT, OutputT> doFn) {\n                      return c.pane();\n                    }\n\n                    @Override\n                    public BoundedWindow window() {\n                      return w;\n                    }\n\n                    @Override\n                    public Object sideInput(String tagId) {\n                      PCollectionView<?> view = sideInputMapping.get(tagId);\n                      if (view == null) {\n                        throw new IllegalArgumentException(\n                            \"calling getSideInput() with unknown view\");\n                      }\n                      return c.sideInput(view);\n                    }\n\n                    @Override\n                    public String getErrorContext() {\n                      return NaiveProcessFn.class.getSimpleName()\n                          + \".invokeGetInitialWatermarkEstimatorState\";\n                    }\n                  });\n\n      RestrictionT restriction = c.element().getValue();\n      WatermarkEstimatorStateT watermarkEstimatorState = initialWatermarkEstimatorState;\n      while (true) {\n        RestrictionT currentRestriction = restriction;\n        WatermarkEstimatorStateT currentWatermarkEstimatorState = watermarkEstimatorState;\n","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/SplittableParDoNaiveBounded.java#L218-L254","documentation":"In SplittableParDoNaiveBounded's translated wrapper DoFn (a naive BoundedSource-based expansion of splittable DoFns), sideInput(tagId) looks up the runner-supplied tag id in sideInputMapping and throws IllegalArgumentException 'calling getSideInput() with unknown view' when not found. As with SplittableParDo, this means the DoFn attempted to read a side input that was not declared on the transform.","triggerScenarios":"A wrapped splittable DoFn's processing callback calls c.sideInput(view) where view's TupleTag is missing from sideInputMapping — i.e. the view was not among the transform's declared side inputs when the naive bounded translation built the mapping.","commonSituations":"Legacy runners using the naive bounded fallback for SplittableParDo with DoFns that read undeclared side inputs, or code refactored to drop a withSideInputs() declaration while the DoFn still accesses the view.","solutions":["Declare the view: .withSideInputs(...) on the SplittableParDo/ParDo transform.","Audit the DoFn's c.sideInput() calls against the transform's declared side inputs.","If the naive fallback is the trigger, check whether the runner can use the standard SplittableParDo translation instead."],"exampleFix":"// before\nitems.apply(SplittableParDo.of(pardo)); // pardo lacks withSideInputs(mapView)\n// after\nitems.apply(SplittableParDo.of(pardo.withSideInputs(mapView)));","handlingStrategy":"validation","validationCode":"for (PCollectionView<?> v : accessedViews(fn)) { if (!pardo.getSideInputs().containsKey(v.getTagInternal())) throw new IllegalStateException(\"Undeclared side input\"); }","typeGuard":null,"tryCatchPattern":"try { return c.sideInput(view); } catch (IllegalArgumentException e) { throw new IllegalStateException(\"Declare view via withSideInputs()\", e); }","preventionTips":["Keep withSideInputs() and DoFn accesses in sync","Add a test that runs the DoFn on a runner exercising the naive path","Check TupleTag identity across refactors"],"tags":["java","beam","side-input","splittable-pardo","naive-bounded"],"backgroundTag":"resource-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}