You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "shuai.xu (Jira)" <ji...@apache.org> on 2020/02/12 03:27:00 UTC

[jira] [Created] (FLINK-16011) Normalize the within usage in Pattern

shuai.xu created FLINK-16011:
--------------------------------

             Summary: Normalize the within usage in Pattern
                 Key: FLINK-16011
                 URL: https://issues.apache.org/jira/browse/FLINK-16011
             Project: Flink
          Issue Type: Improvement
          Components: Library / CEP
    Affects Versions: 1.9.0
            Reporter: shuai.xu


In CEP, we can use Pattern.within() to set a window in which the pattern should be matched. However, the usage of within is ambiguous and confusing to user.

For example:
 # Pattern.begin("a").within(t1).followedBy("b").within(t2) will use the minimal of t1 and t2 as the window time for the whole pattern.
 # Pattern.begin("a").followedBy("b").within(t2) will use t2 as the window time.
 # But Pattern.begin("a").within(t1).followedBy("b") will have no window time
 # While Pattern.begin("a").notFollowedBy("not").within(t1).followedBy("b").within(t2) will use t2 as the window time.

So I propose to normalize the usage of within() and make strict checking when compiling the pattern. 

For example, we can only allow within() at the end of the pattern and point it out if user set it somewhere else when compiling the pattern.



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