dianfu commented on code in PR #19295:
URL: https://github.com/apache/flink/pull/19295#discussion_r898652853
##########
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFACompiler.java:
##########
@@ -157,11 +157,8 @@ public static boolean canProduceEmptyMatches(final
Pattern<?, ?> pattern) {
* create multiple NFAs.
*/
void compileFactory() {
- if (currentPattern.getQuantifier().getConsumingStrategy()
- == Quantifier.ConsumingStrategy.NOT_FOLLOW) {
- throw new MalformedPatternException(
- "NotFollowedBy is not supported as a last part of a
Pattern!");
- }
+
+ Pattern lastPattern = currentPattern;
Review Comment:
```suggestion
Pattern<T, ?> lastPattern = currentPattern;
```
Nit
##########
flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/CEPITCase.java:
##########
@@ -630,6 +630,226 @@ public String select(Map<String, List<Event>> pattern) {
assertEquals(expected, resultList);
}
+ @Test
+ public void testNotFollowedByWithIn() throws Exception {
Review Comment:
Move these test cases to NotPatternITCase?
##########
docs/content/docs/libs/cep.md:
##########
@@ -718,6 +718,35 @@ next.within(Time.seconds(10))
{{< /tab >}}
{{< /tabs >}}
+Notice that A pattern sequence can end in notFollowedBy() with temporal
constraint
Review Comment:
```suggestion
Notice that a pattern sequence can end in notFollowedBy() with temporal
constraint
```
##########
docs/content/docs/libs/cep.md:
##########
@@ -718,6 +718,35 @@ next.within(Time.seconds(10))
{{< /tab >}}
{{< /tabs >}}
+Notice that A pattern sequence can end in notFollowedBy() with temporal
constraint
+E.g. a pattern like:
Review Comment:
need also update the chinese documentation which is located under directory
*content.zh*
--
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]