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

ASF GitHub Bot commented on FLINK-7147:
---------------------------------------

Github user dianfu commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4296#discussion_r135441351
  
    --- Diff: 
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFACompiler.java
 ---
    @@ -421,6 +437,15 @@ private void addStopStateToLooping(final State<T> 
loopingState) {
                                untilCondition,
                                true);
     
    +                   if 
(currentPattern.getQuantifier().hasProperty(Quantifier.QuantifierProperty.GREEDY)
 &&
    +                           times.getFrom() != times.getTo()) {
    +                           if (untilCondition != null) {
    +                                   State<T> sinkStateCopy = 
copy(sinkState);
    +                                   
originalStateMap.put(sinkState.getName(), sinkStateCopy);
    --- End diff --
    
    originalStateMap is used when compiling the NFA and it will be collected 
after NFA is created and so I think it's unnecessary to clear the entries.


> Support greedy quantifier in CEP
> --------------------------------
>
>                 Key: FLINK-7147
>                 URL: https://issues.apache.org/jira/browse/FLINK-7147
>             Project: Flink
>          Issue Type: Sub-task
>          Components: CEP, Table API & SQL
>            Reporter: Dian Fu
>            Assignee: Dian Fu
>
> Greedy quantifier will try to match the token as many times as possible. For 
> example, for pattern {{a b* c}} (skip till next is used) and inputs {{a b1 b2 
> c}}, if the quantifier for {{b}} is greedy, it will only output {{a b1 b2 c}}.



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

Reply via email to