[ 
https://issues.apache.org/jira/browse/FLINK-15841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17029922#comment-17029922
 ] 

Aljoscha Krettek commented on FLINK-15841:
------------------------------------------

I think all code/tests expects the current behaviour, the expectation of the 
session/window merging code is that two windows that have zero gap, i.e. {{(t1, 
t2)}} and {{(t2, t3)}} will be merged because there is no gap in between. 
Therefore I think we shouldn't not (cannot) change the behaviour. We can extend 
the Javadoc of {{intersect()}} to better describe the behaviour.

The class-level Javadoc is still correct, in my opinion. Consider two windows 
{{w1 = (0, 2)}} and {{w2 = (2, 4)}}. They might have these elements in them:
{code}
// value, timestamp
0, 0 // in w1
1, 1 // in w1
2, 2 // in w2
3, 3 // in w2
{code}

I.e. {{w1}} doesn't contain elements of timestamp {{2}}, because the end is 
exclusive. Still, these are two windows that should be merged into one session, 
i.e. they should "intersect".


> TimeWindow.intersects return true for consecutive windows
> ---------------------------------------------------------
>
>                 Key: FLINK-15841
>                 URL: https://issues.apache.org/jira/browse/FLINK-15841
>             Project: Flink
>          Issue Type: Bug
>          Components: API / DataStream
>            Reporter: Jörn Kottmann
>            Assignee: Jörn Kottmann
>            Priority: Trivial
>
> The TimeWindow JavaDoc explains that the start index is inclusive and the end 
> index is exclusive, therefore two windows T0 to T1 and T1 to T2 are next to 
> each other without overlapping.
> To fix this the intersects comparison should be changed to: {{this.start < 
> other.end && this.end > other.start}}
> Also a test should be added to verify the methods works correctly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to