title: How to fix "Joining unbounded PCollections is currently only supported for non-global windows with triggers" in Apache Beam
body: <p>I'm trying to join 2 unbounded sources using Apache Beam Java SDK. While Joining Im getting the below error message.</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.UnsupportedOperationException: Joining unbounded
    PCollections is currently only supported for non-global windows with
    triggers that are known to produce output once per window,such as the
    default trigger with zero allowed lateness. In these cases Beam can
    guarantee it joins all input elements once per window.
    WindowingStrategy{windowFn=org.apache.beam.sdk.transforms.windowing.SlidingWindows@1b87117,
    allowedLateness=PT0S,
    trigger=Repeatedly.forever(AfterProcessingTime.pastFirstElementInPane().plusDelayOf(1
    minute)), accumulationMode=DISCARDING_FIRED_PANES,
    timestampCombiner=EARLIEST} is not supported
          at org.apache.beam.sdk.extensions.sql.impl.rel.BeamJoinRel.verifySupportedTrigger(BeamJoinRel.java:341)
          at org.apache.beam.sdk.extensions.sql.impl.rel.BeamJoinRel.access$1500(BeamJoinRel.java:98)
          at org.apache.beam.sdk.extensions.sql.impl.rel.BeamJoinRel$StandardJoin.expand(BeamJoinRel.java:330)
          at org.apache.beam.sdk.extensions.sql.impl.rel.BeamJoinRel$StandardJoin.expand(BeamJoinRel.java:308)
          at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:537)
          at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:488)
          at org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.toPCollection(BeamSqlRelUtils.java:67)
          at org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.lambda$buildPCollectionList$0(BeamSqlRelUtils.java:48)
          at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
          at java.util.Iterator.forEachRemaining(Iterator.java:116)
          at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
          at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
          at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
          at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
          at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
          at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
          at org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.buildPCollectionList(BeamSqlRelUtils.java:49)
          at org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.toPCollection(BeamSqlRelUtils.java:65)
          at org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils.toPCollection(BeamSqlRelUtils.java:36)
          at org.apache.beam.sdk.extensions.sql.SqlTransform.expand(SqlTransform.java:100)
          at org.apache.beam.sdk.extensions.sql.SqlTransform.expand(SqlTransform.java:76)
          at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:537)
          at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:488)
          at org.apache.beam.sdk.values.PCollectionTuple.apply(PCollectionTuple.java:167)
          at xyz.xyz.main(xyz.java:64)</p>
  </blockquote>
  
  <p>I have tried using both Fixed &amp; Sliding Window along with triggering (pastEndOfWindow &amp; pastFirstElementInPane) with zero allowed lateness. Tried both Accumalate &amp; Discard fired panes. I get the same error message everytime.</p>
  
  <p>Below are 2 snippets i tried using both fixed &amp; sliding window.</p>
  
  <pre class="lang-java prettyprint-override"><code>p1.apply("window",
      Window
        .&lt;Row&gt;into(FixedWindows.of(Duration.standardSeconds(50)))
        .triggering(AfterWatermark.pastEndOfWindow())
        .withAllowedLateness(Duration.ZERO)
        .accumulatingFiredPanes());
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>p1.apply("window2",
      Window.&lt;Row&gt;into(
          SlidingWindows
            .of(Duration.standardSeconds(30))
            .every(Duration.standardSeconds(5)))
        .triggering(
          Repeatedly
            .forever(
               AfterProcessingTime
                 .pastFirstElementInPane()
                 .plusDelayOf(Duration.standardMinutes(1))))
        .withAllowedLateness(Duration.ZERO)
        .discardingFiredPanes());
  </code></pre>
  
  <p>I simply wanted to implement a sql transform with a sliding window, Trigger with delay and allow lateness. Kindly guide me through to implement it.</p>
  
  <p>Thanks,
  Gowtham</p>