0

When using a global window, does the window start from the moment the job starts up and we receive the first event or is it also starting from 00:00:00 1 January 1970 as per this answer: flink Windows, when do they start.

Akula
  • 59
  • 7

1 Answers1

3

Flink's time windows do not start with the epoch (00:00:00 1 January 1970), but rather are aligned with it. For example, if you are using hour-long processing time windows and start a job at 10:53:00 on 20 October 2021, the first of those hour-long windows will end at 10:59.999 20 October 2021.

Global windows are not time windows. A global window is a window assigner that assigns every incoming event to the same window, without regard to the timing. Global windows are designed to be used with custom triggering.

David Anderson
  • 39,434
  • 4
  • 33
  • 60
  • In that sense then, I would decide when the window gets closed by issuing the FIRE triggerResult? The timing logic would happen inside the trigger itself right? – Akula Oct 20 '21 at 09:12
  • 2
    Yes, that's correct. You may also need to implement an Evictor to clear out window elements that should not remain after the window has been fired. – David Anderson Oct 20 '21 at 09:15