{"record":{"id":"5f990a66d4782baa","repo":"apache/beam","slug":"only-s-objects-with-the-same-window-supplier-are-compatible","errorCode":null,"errorMessage":"Only %s objects with the same window supplier are compatible.","messagePattern":"Only (.+?) objects with the same window supplier are compatible\\.","errorType":"exception","errorClass":"IncompatibleWindowException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/testing/StaticWindows.java","lineNumber":102,"sourceCode":"      return Collections.singleton(c.window());\n    } else {\n      return getWindows();\n    }\n  }\n\n  @Override\n  public boolean isCompatible(WindowFn<?, ?> other) {\n    if (!(other instanceof StaticWindows)) {\n      return false;\n    }\n    StaticWindows that = (StaticWindows) other;\n    return Iterables.elementsEqual(this.windows.get(), that.windows.get());\n  }\n\n  @Override\n  public void verifyCompatibility(WindowFn<?, ?> other) throws IncompatibleWindowException {\n    if (!this.isCompatible(other)) {\n      throw new IncompatibleWindowException(\n          other,\n          String.format(\n              \"Only %s objects with the same window supplier are compatible.\",\n              StaticWindows.class.getSimpleName()));\n    }\n  }\n\n  @Override\n  public Coder<BoundedWindow> windowCoder() {\n    return coder;\n  }\n\n  @Override\n  public WindowMappingFn<BoundedWindow> getDefaultWindowMappingFn() {\n    return new WindowMappingFn<BoundedWindow>(Duration.millis(Long.MAX_VALUE)) {\n      @Override\n      public BoundedWindow getSideInputWindow(BoundedWindow mainWindow) {\n        checkArgument(","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/StaticWindows.java#L84-L120","documentation":"StaticWindows.verifyCompatibility() throws IncompatibleWindowException when comparing two StaticWindows window FIFOs that were not created from the same window supplier. Beam's window-fn compatibility check requires StaticWindows instances to originate from the same windowing setup.","triggerScenarios":"Combining PCollections windowed with different StaticWindows instances (different window suppliers) in the same transform, triggering window fn compatibility verification during pipeline construction/validation.","commonSituations":"Merging streams windowed independently in different tests or helper methods; reusing Window.into() results with custom static window setups across pipelines.","solutions":["Ensure both PCollections use windows produced by the same window supplier/StaticWindows setup.","Re-window one of the inputs (e.g. re-apply Window.into() with the same windowing) before combining.","If intentional, restructure so incompatible-windowed inputs are not combined."],"exampleFix":"// before\nPCollection<A> a = inputA.apply(Window.into(StaticWindows.ofSupplier(supplier1)));\n// after\nPCollection<A> a = inputA.apply(Window.into(StaticWindows.ofSupplier(sharedSupplier)));","handlingStrategy":"validation","validationCode":"staticWindows1.isCompatible(staticWindows2); // call before combining PCollections","typeGuard":null,"tryCatchPattern":"try { pipeline.apply(Flatten.of(a, b)); } catch (IncompatibleWindowException e) { /* re-window inputs with the same supplier */ }","preventionTips":["Share one window supplier/windowing setup across PCollections you combine.","Re-window inputs before Flatten/Join when they come from different pipelines.","Check windowing with PCollection.getWindowing() before merging."],"tags":["java","windows","apache-beam","pipeline-construction"],"backgroundTag":"incompatible-source-type","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"}