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

Yueting Chen edited comment on FLINK-7169 at 7/13/17 9:43 AM:
--------------------------------------------------------------

[~dawidwys]
Thanks for the information.
I noticed that. But the counter only keeps the reference count of the value, it 
has some limitations. For example:
We need to match {{a\{2\}}} from {{a1,a2,a3,a4}}, with the AFTER MATCH SKIP 
PAST LAST ROW option.
With no doubt, the first match is {{a1,a2}}. According to the SKIP option, we 
need to start the second match from a3.
But it's possible that all these four events have the same timestamp(1, for 
example). After the first match, we can only get the timestamp of the final 
matched event. Without knowing the exact logical order of the four events, it's 
impossible to skip to the right position. And the counter can't help with that.
What I suggest is to keep a logical id for each event, it does not need to be 
continouse, but it should be monotonically increasing.


was (Author: ychen):
[~dawidwys]
Thanks for the information.
I noticed that. But the counter only keeps the reference count of the value, it 
has some limitations. For example:
We need to match {{a{2}}} from {{a1,a2,a3,a4}}, with the AFTER MATCH SKIP PAST 
LAST ROW option.
With no doubt, the first match is {{a1,a2}}. According to the SKIP option, we 
need to start the second match from a3.
But it's possible that all these four events have the same timestamp(1, for 
example). After the first match, we can only get the timestamp of the final 
matched event. Without knowing the exact logical order of the four events, it's 
impossible to skip to the right position. And the counter can't help with that.
What I suggest is to keep a logical id for each event, it does not need to be 
continouse, but it should be monotonically increasing.

> Support AFTER MATCH SKIP function in CEP library API
> ----------------------------------------------------
>
>                 Key: FLINK-7169
>                 URL: https://issues.apache.org/jira/browse/FLINK-7169
>             Project: Flink
>          Issue Type: Sub-task
>          Components: CEP
>            Reporter: Yueting Chen
>            Assignee: Yueting Chen
>
> In order to support Oracle's MATCH_RECOGNIZE on top of the CEP library, we 
> need to support AFTER MATCH SKIP function in CEP API.
> There're four options in AFTER MATCH SKIP, listed as follows:
> 1. AFTER MATCH SKIP TO NEXT ROW: resume pattern matching at the row after the 
> first row of the current match.
> 2. AFTER MATCH SKIP PAST LAST ROW: resume pattern matching at the next row 
> after the last row of the current match.
> 3. AFTER MATCH SKIP TO FIST *RPV*: resume pattern matching at the first row 
> that is mapped to the row pattern variable RPV.
> 4. AFTER MATCH SKIP TO LAST *RPV*: resume pattern matching at the last row 
> that is mapped to the row pattern variable RPV.
> I think we can introduce a new function to `CEP` class, which takes a new 
> parameter as AfterMatchSKipStrategy.
> The new API may looks like this
> {code}
> public static <T> PatternStream<T> pattern(DataStream<T> input, Pattern<T, ?> 
> pattern, AfterMatchSkipStrategy afterMatchSkipStrategy) 
> {code}
> We can also make `SKIP TO NEXT ROW` as the default option, because that's 
> what CEP library behaves currently.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to