apache/beam · error · UnsupportedOperationException

TVFSlidingWindow does not support side input windows.

Error message

TVFSlidingWindow does not support side input windows.

What it means

TVFSlidingWindowFn maps elements into sliding IntervalWindows for table-valued-function sliding window aggregation. Side inputs require a WindowMappingFn to translate a side-input element's window into main-input windows; sliding windows have no sensible default mapping, so getDefaultWindowMappingFn unconditionally throws UnsupportedOperationException — this operation is simply not supported.

Source

Thrown at sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/TVFSlidingWindowFn.java:83

            "When assigning a sliding window to row: %s is null",
            TVFStreamingUtils.WINDOW_END);

    return ImmutableList.of(new IntervalWindow(windowStart.toInstant(), windowEnd.toInstant()));
  }

  @Override
  public boolean isCompatible(WindowFn<?, ?> other) {
    return equals(other);
  }

  @Override
  public Coder<IntervalWindow> windowCoder() {
    return IntervalWindow.getCoder();
  }

  @Override
  public WindowMappingFn<IntervalWindow> getDefaultWindowMappingFn() {
    throw new UnsupportedOperationException(
        "TVFSlidingWindow does not support side input windows.");
  }
}

View on GitHub (pinned to 12126d8942)

Solutions

  1. Do not consume TVF sliding-window output as a side input; restructure the pipeline so it is consumed as a main input.
  2. Use fixed or global windows (or Beam's direct Window.into with an allowed mapping) if side-input semantics are required.
  3. Perform the join/aggregation inside SQL (a JOIN in the same query) instead of extracting and re-attaching as a side input.
  4. If you truly need a mapping, apply your own Window.into/ReWindow with an explicit WindowMappingFn downstream of the TVF.

Example fix

// before
PCollectionView<...> view = tvfResult.apply(View.asIterable()); // side input of sliding windows
// after
// consume tvfResult as a main input, or re-window first:
tvfResult.apply(Window.into(FixedWindows.of(Duration.standardMinutes(1))))
Defensive patterns

Strategy: fallback

Try / catch

try {
  PCollectionView<X> view = slidingWindowResult.apply(View.asIterable());
  return view;
} catch (UnsupportedOperationException e) {
  if (e.getMessage().contains("does not support side input windows")) {
    // fall back to re-windowing or main-input consumption
    return null;
  }
  throw e;
}

Prevention

When it happens

Trigger: Using a TVF sliding-window relation where Beam needs the default window mapping fn — i.e. accessing this PCollection (or the SQL query's output) as a side input of another transform.

Common situations: Piping a sliding-window SQL query result into View.asIterable/asMap and consuming it as a side input; joining a sliding-windowed TVF output with another PCollection via side-input semantics.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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