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

.window(TumblingEventTimeWindows.of(Time.days(1), Time.hours(-8))) doesn't work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.2.0
    • None
    • API / DataStream
    • None
    • Flink 1.2.0.

    • Important

    Description

      The tutorial on the official website says that we can use

      // daily tumbling event-time windows offset by -8 hours.
      input
      .keyBy(<key selector>)
      .window(TumblingEventTimeWindows.of(Time.days(1), Time.hours(-8)))
      .<windowed transformation>(<window function>);

      when our timezone is UTC+8, which is in China. But when I tried to run this code, it just reported an error:

      Exception in thread "main" java.lang.IllegalArgumentException: TumblingProcessingTimeWindows parameters must satisfy 0 <= offset < size
      at org.apache.flink.streaming.api.windowing.assigners.TumblingProcessingTimeWindows.<init>(TumblingProcessingTimeWindows.java:54)
      at org.apache.flink.streaming.api.windowing.assigners.TumblingProcessingTimeWindows.of(TumblingProcessingTimeWindows.java:111)

      How then, should I write my code to make a tumbling window which clears every day at 00:00, when my timezone is UTC+8?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vbnetvbnet Lix
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: