GitHub user Aitozi opened a pull request: https://github.com/apache/flink/pull/6124
[FLINK-8914][CEP]Fix wrong semantic when greedy pattern is the head of the pattern ## What is the purpose of the change As described in the jira [FLINK-8914](https://issues.apache.org/jira/projects/FLINK/issues/FLINK-8914) There is something wrong with `greedy` when it is the head of the pattern. Because the `NFA` process each `ComputationState` and will produce a new `Start ComputationState`. So when it runs into the greedy match, other `start runs` can also be set up ## Brief change log *(for example:)* - *Add a new StateType `Greedy` for convenience of distinguishing the greedy in computations* - *Remove the redundant start state during process* ## Verifying this change Add two UT in `GreedyITCase` You can merge this pull request into a Git repository by running: $ git pull https://github.com/Aitozi/flink greedyfix Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/6124.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #6124 ---- commit 76c1a4516b4bc98043d944335cc7a0aacd359278 Author: minwenjun <minwenjun@...> Date: 2018-06-05T16:07:55Z Fix wrong semantic when greedy pattern is the head of the pattern ---- ---