As far as I understand, when there is no message to consume, Spark will not advance the watermark, and the condition to emit the last window will not be met until a new message is consumed.