[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16394935#comment-16394935 ] ASF GitHub Bot commented on FLINK-4641: --- Github user chermenin commented on the issue: https://github.com/apache/flink/pull/3105 @Aitozi I just didn't have enough time to finish my work on this task and the Pattern API was changed at the same time. Now it's needed to rewrite the code to support all updates. > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu >Priority: Major > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16394873#comment-16394873 ] ASF GitHub Bot commented on FLINK-4641: --- Github user Aitozi commented on the issue: https://github.com/apache/flink/pull/3105 why it is closed ? Is it has been merged in? > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu >Priority: Major > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16121550#comment-16121550 ] zhangxiaoyu commented on FLINK-4641: I have two cases to discuss with you. (a*|b*)c with strategy SKIP_TILL_NEXT, when event c comes, both branches are matched, so output {c, c}, should it be like this? (a|~b)a with strategy SKIP_TILL_NEXT, when event a comes, output {a, a}? Please have a look at my design doc https://docs.google.com/document/d/1YNjOYF7BagM4agx_TI6hQkmraVLT9ZpKhBsgHDGi-U8/edit#. > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16087676#comment-16087676 ] ASF GitHub Bot commented on FLINK-4641: --- Github user chermenin closed the pull request at: https://github.com/apache/flink/pull/3105 > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16080002#comment-16080002 ] Dian Fu commented on FLINK-4641: I agree with you. This would also make the implementation easier as we do not need to consider other branches any more once one branch is matched. Thanks a lot for sharing your thought. > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16079997#comment-16079997 ] Dawid Wysakowicz commented on FLINK-4641: - I think {{a b1 c1 c2 d2 e}} is a valid output for that case, whereas the {{a d1 d2 e}} is not. For the second case as we use {{SKIP_TILL_NEXT}} the group already started with {{b1 c1}}, so it should not start with {{d1}}. In the first case, as we do not stop accepting events into a looping state right now(if there is no timeout or {{until}} condition), I think the given example is valid. What do you think? [~dian.fu] > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16077624#comment-16077624 ] Dian Fu commented on FLINK-4641: Hi [~dawidwys], just think of one more use case: for the above second example, pattern {noformat}a ( ( b c{1,} ) | d ) {2} e{noformat} if the inputs are {{a, b1, c1, d1, c2, d2, e}}, what do you think the output should be? Will it contain {{a b1 c1 c2 d2 e}} or {{a d1 d2 e}}? > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16076276#comment-16076276 ] Dian Fu commented on FLINK-4641: I have the same thought. :) I'm asking this question is because I found that to achieve the above results, we need make some modifications to the NFA. As when one branch is matched, we need to eliminate all the {{ComputationState}}s corresponding to other branches. Just to confirm my thought is right before make the changes. :) > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16076264#comment-16076264 ] Dawid Wysakowicz commented on FLINK-4641: - So for a pattern like: {noformat} a ( ( b c{1,} ) | d ) {2} e {noformat} Where only {{skip till next}} is used. I think it should be {{a b1 c1 c2 d1 e}} {{a b1 c1 d1 e}}. What do you think? > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16076250#comment-16076250 ] Dian Fu commented on FLINK-4641: Thanks a lot for your inputs. [~dawidwys] For the second example, the {{OR}} applies to {{b.followedBy(c).oneOrMore()}}. The continuity is {{skip till next}}. > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16076241#comment-16076241 ] Dawid Wysakowicz commented on FLINK-4641: - In the first case I think it depends on the continuity between {{a}} and the {{group pattern}}. 1 - is valid for skip till next(or strict), 2 - for skip till any In second example to which patterns applies the {{OR}}? If the {{OR}} applies to {{c.times(1,inf)}} and {{d}} then I think there is no matches as there is only one {{b}}. Also what continuity should I assume? The skip till any? > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16076222#comment-16076222 ] Dian Fu commented on FLINK-4641: @[~dawidwys] @[~kkl0u] One more example: For pattern: {noformat} a ( b c{1,} | d){2} e {noformat} and inputs {{a, b1, c1, c2, d1, d2, e}} What do you think the output should be? > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16076189#comment-16076189 ] Dian Fu commented on FLINK-4641: @dawidwys @kl0u I'm currently working this ticket. I have some doubt and want to hear your thought. For pattern: {{a (b | (c d)) e}} and inputs {{a b c d e}}, what do you think the output should be? 1) {{a b e}} or 2) {{a b e}} and {{a c d e}} > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Sub-task > Components: CEP >Reporter: Till Rohrmann >Assignee: Dian Fu > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16050551#comment-16050551 ] Alexander Chermenin commented on FLINK-4641: Hi [~dian.fu]! Yes of course, you're welcome! Unfortunately I don't have enough time to do it. > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Improvement > Components: CEP >Reporter: Till Rohrmann >Assignee: Alexander Chermenin > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16049178#comment-16049178 ] Dian Fu commented on FLINK-4641: Hi [~chermenin], are you still working on this JIRA? It seems that the patch is obsolete. If you don't mind, I'd like to take it over. > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Improvement > Components: CEP >Reporter: Till Rohrmann >Assignee: Alexander Chermenin > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15820896#comment-15820896 ] ASF GitHub Bot commented on FLINK-4641: --- GitHub user chermenin opened a pull request: https://github.com/apache/flink/pull/3105 [FLINK-4641] Support branching CEP patterns Support for branched CEP patterns was added in this PR. After merging that we will be able to use follow code to define more complex patterns: ``` Patternpattern = EventPattern.event("start") .next( Pattern.or( EventPattern.event("middle_1").subtype(F.class)), EventPattern.event("middle_2").where(new MyFilterFunction()) )) .followedBy(EventPattern.event("end")); ``` This PR will close https://issues.apache.org/jira/browse/FLINK-4641. You can merge this pull request into a Git repository by running: $ git pull https://github.com/chermenin/flink flink-4641 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3105.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3105 commit 026ada648d1277fd57f2fb2361a36bf0c8f5e57b Author: Aleksandr Chermenin Date: 2017-01-12T09:54:44Z [FLINK-4641] Base Java implementation. commit f82fc8386493e84e824110a26d5e059333efaec0 Author: Aleksandr Chermenin Date: 2017-01-12T10:07:53Z [FLINK-4641] Fixed branching pattern. commit ad074e2e2c1faf8571b8b8e7ce3144c0fbc5e31d Author: Aleksandr Chermenin Date: 2017-01-12T10:21:15Z [FLINK-4641] Fixed Scala API. commit 38e14a89b001bd443133746216d422ac46176c3f Author: Aleksandr Chermenin Date: 2017-01-12T10:56:22Z [FLINK-4641] Fixed tests for Scala API. commit 9ba130df964ece5b8756e8b46b6ec22dcde69877 Author: Aleksandr Chermenin Date: 2017-01-12T12:15:01Z [FLINK-4641] Fixed CEP Java 8 lambda test. commit 8d490aae497e85003a402ca6c1fd687e30c3b55f Author: Aleksandr Chermenin Date: 2017-01-12T12:24:52Z [FLINK-4641] Improved code documentation. > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Improvement > Components: CEP >Reporter: Till Rohrmann >Assignee: Alexander Chermenin > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15512390#comment-15512390 ] Ivan Mushketyk commented on FLINK-4641: --- Hi [~kervel] I think the method chaining will allow nested branching, but it may be a bit cumbersome. The first option with nested method calls seems to be a simpler option, but changes the API style a bit. > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Improvement > Components: CEP >Reporter: Till Rohrmann > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15510291#comment-15510291 ] Frank Dekervel commented on FLINK-4641: --- i think the second option would made it hard to nest branching patterns ? will method chaining keep working when doing more complex state transition hierarchies? (i think supporting cyclic patterns like the following is out of scope for this ticket) eg (trying to make up a more complex example) suppose that one of the branches is two states K and B, and the system can go from one state back to the other, and the C state can be followedBy the D state, but if D happens after K, it should be next not followedby... {noformat} . |<---| .|--> B -- K--| A -- ||-->D .|--> C --| {noformat} (would maybe only be useful together with an implementation for #3703) Frank > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Improvement > Components: CEP >Reporter: Till Rohrmann > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FLINK-4641) Support branching CEP patterns
[ https://issues.apache.org/jira/browse/FLINK-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15508942#comment-15508942 ] Ivan Mushketyk commented on FLINK-4641: --- What API should we define for this feature? Should it be something like: {code} begin("A") .or(event("B").where(...)) .either(event("C").where(...)) .followedBy("D") {code} or something like: {code} begin("A") .or().event("B").where(...) .either().event("C").where(...) .followedBy("D") {code} > Support branching CEP patterns > --- > > Key: FLINK-4641 > URL: https://issues.apache.org/jira/browse/FLINK-4641 > Project: Flink > Issue Type: Improvement > Components: CEP >Reporter: Till Rohrmann > > We should add support for branching CEP patterns to the Pattern API. > {code} > |--> B --| > || > A -- --> D > || > |--> C --| > {code} > This feature will require changes to the {{Pattern}} class and the > {{NFACompiler}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)