Moritz Manner created FLINK-21977: ------------------------------------- Summary: Allow bigger offset in SlidingProcessingTimeWindows Key: FLINK-21977 URL: https://issues.apache.org/jira/browse/FLINK-21977 Project: Flink Issue Type: Bug Components: API / DataStream Affects Versions: 1.12.2 Reporter: Moritz Manner
According to the docs about [Windows|https://ci.apache.org/projects/flink/flink-docs-stable/dev/stream/operators/windows.html#sliding-windows], the _SlidingProcessingTimeWindows_ supports an _offset_ with an absolute value bigger than the _slide_ of the window: {code:java} // sliding processing-time windows offset by -8 hours input .keyBy(<key selector>) .window(SlidingProcessingTimeWindows.of(Time.hours(12), Time.hours(1), Time.hours(-8))) .<windowed transformation>(<window function>);{code} This is currently not possible, as an _IllegalArgumentException_ will be thrown if the absolute value of the _offset_ is bigger than the _slide_. {code:java} private SlidingProcessingTimeWindows(long size, long slide, long offset) { if (Math.abs(offset) >= slide || size <= 0) { throw new IllegalArgumentException( "SlidingProcessingTimeWindows parameters must satisfy " + "abs(offset) < slide and size > 0"); } this.size = size; this.slide = slide; this.offset = offset; }{code} I suspect the absolute value of the _offset_ should be compared to the *_size_* of the window - similar to the _TumblingProcessingTimeWindows._ This problem exists also in the _Sliding*Event*TimeWindows._ -- This message was sent by Atlassian Jira (v8.3.4#803005)