@Test @Category(NeedsRunner.class) public void testRemerge() { List<KV<String, Integer>> ungroupedPairs = Arrays.asList(); PCollection<KV<String, Integer>> input = p.apply( Create.of(ungroupedPairs) .withCoder(KvCoder.of(StringUtf8Coder.of(), BigEndianIntegerCoder.of()))) .apply(Window.into(Sessions.withGapDuration(Duration.standardMinutes(1)))); PCollection<KV<String, Iterable<Iterable<Integer>>>> middle = input .apply("GroupByKey", GroupByKey.create()) .apply("Remerge", Window.remerge()) .apply("GroupByKeyAgain", GroupByKey.create()) .apply("RemergeAgain", Window.remerge()); p.run(); Assert.assertTrue( middle .getWindowingStrategy() .getWindowFn() .isCompatible(Sessions.withGapDuration(Duration.standardMinutes(1)))); }
.apply(Window.remerge()) .setWindowingStrategyInternal(input.getWindowingStrategy()); PCollection<KV<K, InputOrAccum<InputT, AccumT>>> preprocessedCold =