twalthr commented on a change in pull request #6815: [FLINK-7062][cep][table]
Added basic support for MATCH_RECOGNIZE
URL: https://github.com/apache/flink/pull/6815#discussion_r224353161
##########
File path:
flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/nfa/AfterMatchSkipITCase.java
##########
@@ -548,6 +548,32 @@ public boolean filter(Event value) throws Exception {
));
}
+ @Test(expected = FlinkRuntimeException.class)
+ public void testSkipToFirstElementOfMatch() throws Exception {
+ List<StreamRecord<Event>> streamEvents = new ArrayList<>();
+
+ Event a1 = new Event(1, "a1", 0.0);
+
+ streamEvents.add(new StreamRecord<Event>(a1));
+
+ Pattern<Event, ?> pattern = Pattern.<Event>begin("a",
+
AfterMatchSkipStrategy.skipToFirst("a").throwExceptionOnMiss()
+ ).where(
+ new SimpleCondition<Event>() {
+
+ @Override
+ public boolean filter(Event value) throws
Exception {
+ return value.getName().contains("a");
+ }
+ }
+ );
+ NFA<Event> nfa = compile(pattern, false);
+
+ feedNFA(streamEvents, nfa, pattern.getAfterMatchSkipStrategy());
+
+ //exception should be thrown
Review comment:
It would be a better comment if you explain *why* an exception should be
thrown.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services