apache/beam · error · IllegalArgumentException

calling getSideInput() with unknown view

Error message

calling getSideInput() with unknown view

What it means

In SplittableParDo's translated DoFn wrapper, the DoFnProcessContext.sideInput(tagId) callback looks up the requested tag id in sideInputMapping (built from the transform's declared side inputs) and throws IllegalArgumentException 'calling getSideInput() with unknown view' when the tag is absent, so the runner's side-input access can be mapped back to the user's PCollectionView. This happens when a DoFn requests a side input that was never declared for the transform.

Source

Thrown at sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/SplittableParDo.java:563

                    public InputT element(DoFn<InputT, OutputT> doFn) {
                      return c.element();
                    }

                    @Override
                    public Instant timestamp(DoFn<InputT, OutputT> doFn) {
                      return c.timestamp();
                    }

                    @Override
                    public PipelineOptions pipelineOptions() {
                      return c.getPipelineOptions();
                    }

                    @Override
                    public Object sideInput(String tagId) {
                      PCollectionView<?> view = sideInputMapping.get(tagId);
                      if (view == null) {
                        throw new IllegalArgumentException(
                            "calling getSideInput() with unknown view");
                      }
                      return c.sideInput(view);
                    }

                    @Override
                    public PaneInfo paneInfo(DoFn<InputT, OutputT> doFn) {
                      return c.pane();
                    }

                    @Override
                    public BoundedWindow window() {
                      return w;
                    }

                    @Override
                    public String getErrorContext() {
                      return PairWithRestrictionFn.class.getSimpleName()

View on GitHub (pinned to 12126d8942)

Solutions

  1. Add the missing view to the ParDo transform: ParDo.of(fn).withSideInputs(view1, view2).
  2. Audit the DoFn for every c.sideInput(...) call and ensure each view is declared.
  3. Verify the view belongs to the same Pipeline and was not constructed for another graph.

Example fix

// before
PCollection<String> out = items.apply(ParDo.of(fn)); // fn calls c.sideInput(mapView)
// after
PCollection<String> out = items.apply(ParDo.of(fn).withSideInputs(mapView));
Defensive patterns

Strategy: validation

Validate before calling

Set<TupleTag<?>> declared = pardo.getSideInputs().keySet(); checkAccessedSideInputs(doFn, declared); // fail fast if DoFn reads undeclared views

Try / catch

try { return c.sideInput(view); } catch (IllegalArgumentException e) { throw new IllegalStateException("Side input view must be declared via withSideInputs()", e); }

Prevention

When it happens

Trigger: A DoFn's processElement (or an OnTimer/FinishBundle callback) calls c.sideInput(view) with a view that is not in the SplittableParDo transform's declared side-input list, so sideInputMapping.get(tagId) returns null.

Common situations: DoFns reading side inputs conditionally with views not passed via .withSideInputs(), refactored pipelines where a side input was removed from withSideInputs but still accessed in the DoFn, or views from a different Pipeline instance.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/688fde002452b786. Report an issue: GitHub.