You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Michael Radford <mu...@gmail.com> on 2016/04/14 23:45:39 UTC

WindowOperator initial watermark

This is a really minor issue, but it confused me during testing.

The WindowOperator initial watermark is -1:

https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java#L136

Whereas TimestampsAndPunctuatedWatermarksOperator uses Long.MIN_VALUE:

https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/TimestampsAndPunctuatedWatermarksOperator.java#L39

I happened to be testing with time values near 0 (including negative
ones) so that it was easier to see what window a timestamp belonged
in, and it was mysterious at first where the -1 watermark was coming
from, when my code was starting with watermarks below that.

I doubt many users are processing data from 1969 with Flink, but
perhaps it's better to use Long.MIN_VALUE everywhere?

Mike

Re: WindowOperator initial watermark

Posted by Aljoscha Krettek <al...@apache.org>.
Yes, you are right, that's a bit inconsistent. I'll push a commit to fix it.

On Thu, 14 Apr 2016 at 23:45 Michael Radford <mu...@gmail.com> wrote:

> This is a really minor issue, but it confused me during testing.
>
> The WindowOperator initial watermark is -1:
>
>
> https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java#L136
>
> Whereas TimestampsAndPunctuatedWatermarksOperator uses Long.MIN_VALUE:
>
>
> https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/TimestampsAndPunctuatedWatermarksOperator.java#L39
>
> I happened to be testing with time values near 0 (including negative
> ones) so that it was easier to see what window a timestamp belonged
> in, and it was mysterious at first where the -1 watermark was coming
> from, when my code was starting with watermarks below that.
>
> I doubt many users are processing data from 1969 with Flink, but
> perhaps it's better to use Long.MIN_VALUE everywhere?
>
> Mike
>