{"record":{"id":"126d0f9431873d27","repo":"apache/beam","slug":"tvfslidingwindow-does-not-support-side-input-windows","errorCode":null,"errorMessage":"TVFSlidingWindow does not support side input windows.","messagePattern":"TVFSlidingWindow does not support side input windows\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/TVFSlidingWindowFn.java","lineNumber":83,"sourceCode":"            \"When assigning a sliding window to row: %s is null\",\n            TVFStreamingUtils.WINDOW_END);\n\n    return ImmutableList.of(new IntervalWindow(windowStart.toInstant(), windowEnd.toInstant()));\n  }\n\n  @Override\n  public boolean isCompatible(WindowFn<?, ?> other) {\n    return equals(other);\n  }\n\n  @Override\n  public Coder<IntervalWindow> windowCoder() {\n    return IntervalWindow.getCoder();\n  }\n\n  @Override\n  public WindowMappingFn<IntervalWindow> getDefaultWindowMappingFn() {\n    throw new UnsupportedOperationException(\n        \"TVFSlidingWindow does not support side input windows.\");\n  }\n}\n","sourceCodeStart":65,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/TVFSlidingWindowFn.java#L65-L87","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Do not consume TVF sliding-window output as a side input; restructure the pipeline so it is consumed as a main input.","Use fixed or global windows (or Beam's direct Window.into with an allowed mapping) if side-input semantics are required.","Perform the join/aggregation inside SQL (a JOIN in the same query) instead of extracting and re-attaching as a side input.","If you truly need a mapping, apply your own Window.into/ReWindow with an explicit WindowMappingFn downstream of the TVF."],"exampleFix":"// before\nPCollectionView<...> view = tvfResult.apply(View.asIterable()); // side input of sliding windows\n// after\n// consume tvfResult as a main input, or re-window first:\ntvfResult.apply(Window.into(FixedWindows.of(Duration.standardMinutes(1))))","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  PCollectionView<X> view = slidingWindowResult.apply(View.asIterable());\n  return view;\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"does not support side input windows\")) {\n    // fall back to re-windowing or main-input consumption\n    return null;\n  }\n  throw e;\n}","preventionTips":["Never use TVF sliding-window output as a side input.","Do joins inside the SQL query instead of via side inputs.","Re-window with FixedWindows or GlobalWindows before View.as* if a materialized view is needed."],"tags":["java","windowing","side-input","unsupported","beam-sql"],"backgroundTag":"unsupported-operation","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"}