Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-21977

Allow bigger offset in SlidingProcessingTimeWindows

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.12.2
    • Fix Version/s: None
    • Component/s: API / DataStream
    • Labels:
      None

      Description

      According to the docs about Windows, the SlidingProcessingTimeWindows supports an offset with an absolute value bigger than the slide of the window:

       

      // 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>);

       

      This is currently not possible, as an IllegalArgumentException will be thrown if the absolute value of the offset is bigger than the slide.

      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;
      }

      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.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              moritz.manner Moritz Manner

              Dates

              • Created:
                Updated:

                Issue deployment