I have a program that contains window operator. It works perfectly in streaming mode. However, when I switch to batch mode, window is not emitted. My question is:
I assume you are referring using to batch execution mode with the DataStream or Table API (and not the legacy DataSet API).
Watermarks are unnecessary in batch mode, but you do need to use a source that handles bounded inputs, so that Flink realizes it has fully processed all of the input. For example, if you are using the KafkaSource
you must use setBounded()
, or if you are using the FileSource
then you should not use monitorContinuously()
.