You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yue Ma (Jira)" <ji...@apache.org> on 2022/04/18 03:53:00 UTC

[jira] [Commented] (FLINK-26941) Support Pattern end with notFollowedBy with window

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

Yue Ma commented on FLINK-26941:
--------------------------------

[~dwysakowicz] [~aljoscha] Could you please take a look at this ticket ? 

> Support Pattern end with notFollowedBy with window
> --------------------------------------------------
>
>                 Key: FLINK-26941
>                 URL: https://issues.apache.org/jira/browse/FLINK-26941
>             Project: Flink
>          Issue Type: Improvement
>          Components: Library / CEP
>    Affects Versions: 1.14.4
>            Reporter: Yue Ma
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.14.4
>
>
> Currently a pattern sequence cannot end in notFollowedBy() in Flink CEP. But in fact, this requirement exists in many scenarios. As mentioned in the following tickets:
> https://issues.apache.org/jira/browse/FLINK-16010
> https://issues.apache.org/jira/browse/FLINK-9431
> Unfortunately, these tickets are not active for a long time.But we still think this is an important feature for Flink CEP, so we would like to share our implementation.
> If we want to find the users who created an order but didn't pay in 10 minutes. We could code like this:
> {code:java}
> Pattern.begin('create').notFollowedBy('pay_order').withIn(10min){code}
> If we receive the create event but don't receive the pay event within 10 minutes, then the match will be successful.
> The idea of implementation is basically the same as the design of FLINK-16010.
> A Pending State is introduced to represent the state of waiting for a timeout, and there is a take edge between the Pending node and the Stop node.
> When advanceTime, if it is found that the pending node has timed out, then extract the timeout sequence and output it normally as successed matched sequence.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)