[DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-05-04 Thread Nicholas
Hi everyone, Pattern#withIn interface in CEP defines the maximum time interval in which a matching pattern has to be completed in order to be considered valid, which interval corresponds to the maximum time gap between first and the last event. The interval representing the maximum time gap

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-05-06 Thread yue ma
hi Nicholas , Nicholas 于2022年5月5日周四 14:28写道: > Hi everyone, > > > > > Pattern#withIn interface in CEP defines the maximum time interval in which > a matching pattern has to be completed in order to be considered valid, > which interval corresponds to the maximum time gap between first and the >

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-05-06 Thread yue ma
hi Nicholas, Thanks for bringing this discussion, we also think it's a useful feature. Some fine-grained timeout pattern matching can be implemented in CEP which makes Flink CEP more powerful Nicholas 于2022年5月5日周四 14:28写道: > Hi everyone, > > > > > Pattern#withIn interface in CEP defines the ma

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-05-07 Thread Dian Fu
Hi Nicholas, Thanks a lot for bringing up this discussion. If I recall it correctly, this feature has been requested many times by the users and is among one of the most requested features in CEP. So big +1 to this feature overall. Regarding the API, the name `partialWithin` sounds a little weird

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-05-25 Thread Martijn Visser
Hi Nicholas, Thanks for creating the FLIP, I can imagine that there will be many use cases who can be created using this new feature. The FLIP doesn't mention anything with regards to SQL, could this feature also be supported when using MATCH_RECOGNIZE? Best regards, Martijn https://twitter.com

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-05-30 Thread Nicholas Jiang
Hi Dian, Thanks for your feedback about supprting the within between events feature. I have updated the FLIP for introduction of 'Pattern#within(WithinType withInType, Time windowTime)' interface. Regarding your comments, I have the following thoughts: - Regarding the API, the name `partialWit

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-05-30 Thread Nicholas Jiang
Hi Yue, Thanks for providing the benefit of this feature. After this feature is merged, you are welcome to try this feature in business scenarios. Regards, Nicholas Jiang On 2022/05/06 11:31:48 yue ma wrote: > hi Nicholas, > > Thanks for bringing this discussion, we also think it's a useful fe

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-05-30 Thread Nicholas Jiang
Hi Martijn, Sorry for later reply. This feature is only supported in DataStream and doesn't be supported in MATCH_RECOGNIZE because the SQL syntax of MATCH_RECOGNIZE does not contain the semantics of this feature, which requires modification of the SQL syntax. The support above MATCH_RECOGNIZE

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-06-06 Thread Dian Fu
Hi Nicholas, Thanks a lot for the update. Regarding the pattern API, should we also introduce APIs such as Pattern.times(int from, int to, Time windowTime) to indicate the time interval between events matched in the loop? Regarding the naming of the classes, does it make sense to rename `WithinT

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-06-07 Thread Martijn Visser
Hi Nicholas, It is disappointing that we can't support this in SQL. I am under the impression that currently all CEP capabilities are supported in both DataStream/Table API as well as SQL. If that's indeed the case, then I would rather have this also fixed for SQL to avoid introducing feature spar

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-06-08 Thread Dian Fu
Hi Martijn, There are many features available in the DataStream API of CEP not supported in SQL, e.g. followedBy, notFollowedBy, followedByAny, etc. The main reason is that the MATCH_RECOGNIZE clause which comes from SQL standard doesn't define grammars for these semantics. There are two ways to

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-06-08 Thread Nicholas Jiang
Hi Dian, Thanks for your feedback about the Public Interface update for supporting the within between events feature. I have left the comments for above points: - Regarding the pattern API, should we also introduce APIs such as Pattern.times(int from, int to, Time windowTime) to indicate the ti

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-06-08 Thread Martijn Visser
Hi Nicholas, Thanks for clarifying the current feature sparsity between DataStream/Table and SQL on this topic. I think it's an interesting topic for a future discussion but let's definitely keep it out of scope for this FLIP. It would be nice to have a follow-up discussion on this in the future :

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-06-08 Thread Nicholas Jiang
Hi Dian, About the indication of the time interval between events matched in the loop. I have updated the FLIP and introduced a series of times interface to specify that this pattern can occur the specified times and interval corresponds to the maximum time gap between previous and next event f

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-06-10 Thread Dian Fu
Hi Nicholas, Regarding the naming of `WithinType`, I'm OK with it. For `PREVIOUS_AND_NEXT`, I guess `PREVIOUS_AND_CURRENT` makes more sense. What's your thought? Regards, Dian On Thu, Jun 9, 2022 at 10:09 AM Nicholas Jiang wrote: > Hi Dian, > > About the indication of the time interval between

Re: [DISCUSS] FLIP-228: Support Within between events in CEP Pattern

2022-06-10 Thread Nicholas Jiang
Hi Dian, Guys, Thanks for your suggestion for the `PREVIOUS_AND_CURRENT`. I have updated the naming of WithinType value in the FLIP. If there are no other questions, I will start the VOTE thread next Monday. Regards, Nicholas Jiang On 2022/06/10 10:02:46 Dian Fu wrote: > Hi Nicholas, > > Reg