Abacn commented on issue #21882:
URL: https://github.com/apache/beam/issues/21882#issuecomment-1182167349

   Not familiar with kotlin, but cannot reproduce this with Java code snippet, 
using either release-2.39.0 or master. Setting a log in the referred method, 
confirmed that the method was evaluated.
   
   ```java
   
   @Test
     public void TestWriteUsingWindow() throws Exception {
       String tableName = DatabaseTestHelper.getTestTableName("UT_WRITE");
       DatabaseTestHelper.createTable(DATA_SOURCE, tableName);
   
       pipeline.apply("Generate Periodic Impulse",
               
PeriodicImpulse.create().startAt(Instant.now()).stopAt(Instant.now().plus(Duration.standardSeconds(14))).withInterval(Duration.standardSeconds(5)))
           .apply("Generate Records", ParDo.of(
               new DoFn<Instant, KV<Integer, String>>() {
                 @ProcessElement
                 public void processElement(ProcessContext context) {
                   ArrayList<KV<Integer, String>> data = getDataToWrite(10);
                   for(KV<Integer, String> datum: data) {
                     context.output(datum);
                   }
                 }
               }))
           .apply(
               "WaitForLines",
               Window.<KV<Integer, 
String>>into(FixedWindows.of(Duration.standardSeconds(5)))
                   .triggering(AfterWatermark.pastEndOfWindow())
                   .discardingFiredPanes()
                   .withAllowedLateness(Duration.ZERO))
           .apply(getJdbcWrite(tableName));
   
       pipeline.run();
   
       assertRowCount(DATA_SOURCE, tableName, 3*10);
       DatabaseTestHelper.deleteTable(DATA_SOURCE, tableName);
     }
   ```
   
   Likely due to compiler not correctly infer the signature of 
`FinishBundleContext.output` here? In DoFn class it has a type of 
BoundedWindow. Both GlobalWindow and IntervalWindow can be cast to 
BoundedWindow.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to