Hellen
Hellen

Reputation: 3532

Event time window in Flink does not trigger

When I use flink event time window, the window just doesn't trigger. How can I solve the problem, and are there any ways to debug?

Upvotes: 2

Views: 2750

Answers (2)

Hellen
Hellen

Reputation: 3532

As you are using the event time window, it is probably a watermark problem. The window only output when watermarks make a progress. There are some reasons why the event time has not been advanced:

  1. There are no data from the source
  2. One of the source parallelisms doesn't have data
  3. The time field extracted from the record should be millisecond instead of second.
  4. Data should cover a longer time span than the window size to advance the event time.

The window will output if we change event time to processing time. Furthermore, we can monitor event time by checking the watermarks in the web dashboard[1] or print-debug it with a ProcessFunction which can lookup the current watermark.

[1] https://ci.apache.org/projects/flink/flink-docs-master/monitoring/debugging_event_time.html#monitoring-current-event-time

Upvotes: 7

gcandal
gcandal

Reputation: 957

Be sure you're setting environment.setStreamTimeCharacteristic(TimeCharacteristic.EventTime).

Upvotes: 2

Related Questions