Hi

Next step in my experiments with Beam: custom windowing. It works (at least
on direct runner) but it looks that my custom window implementation is
somehow not compatible with inOnTimePane assertion.

Without paneinfo assertion unit test passes, with inOnTimePane assertion
the expected element is not found in the PCollection/SCollection.

Test in green (Scio code with some syntactic sugar for handling Joda
Instant):

ctrs.withTimestamp should containSingleValueAtTime("12:00:00",
adCtrOneByScreen)

Test in red:

ctrs.withTimestamp should inOnTimePane("12:00:00", "12:00:01") {
  containSingleValueAtTime("12:00:01", adCtrOneByScreen)
}

PaneInfo and Window details:
PaneInfo{isFirst=true, isLast=true, timing=ON_TIME, index=0, onTimeIndex=0})
CtrWindow{start=1970-01-01T12:00:00.000Z, end=1970-01-01T12:00:01.000Z,
screenId='any screen id', adId='any ad id', isClick='true'}

I've been lost in the runner internals, why there is no PaneInfo extracted
for my custom window and given assertion in class
org.apache.beam.sdk.testing.PaneExtractors.ExtractOnTimePane?

Any help will be appreciated :) The full example is available on Github.

Test:
https://github.com/mkuthan/beam-examples/blob/77f178ea87bb09ad1875a031d35850544aebb387/src/test/scala/org/mkuthan/beam/examples/AdCtrCustomWindowCalculatorTest.scala#L30

Custom window implementation (it inherits directly from BoundedWindow):
https://github.com/mkuthan/beam-examples/blob/master/src/main/scala/org/mkuthan/beam/examples/AdEventWindow.scala

Marcin

Reply via email to