MartijnVisser commented on code in PR #28822:
URL: https://github.com/apache/flink/pull/28822#discussion_r4713916034


##########
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/CepOperator.java:
##########
@@ -369,6 +369,11 @@ public void onProcessingTime(InternalTimer<KEY, 
VoidNamespace> timer) throws Exc
 
         // STEP 4
         updateNFA(nfa);
+
+        // In order to remove dangling partial matches.
+        if (nfa.getPartialMatches().size() == 1 && 
nfa.getCompletedMatches().isEmpty()) {
+            computationStates.clear();

Review Comment:
   What do you think about clearing in `updateNFA` instead, whenever only the 
initial state would be written back? Locally that also covered patterns without 
`WITHIN` or with `PREVIOUS_AND_CURRENT`, with the same output.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to