as the description in flink CEP document:
Strict Contiguity:
Expects all matching events to appear strictly one after the other, without any non-matching events in-between.Relaxed Contiguity
: Ignores non-matching events appearing in-between the matching ones.Non-Deterministic Relaxed Contiguity
: Further relaxes contiguity, allowing additional matches that ignore some matching events.
first example is easy to understand:
given the pattern : "a b"
and the input "a", "c", "b1", "b2"
- Strict Contiguity output :
{} (no match)
- Relaxed Contiguity output :
{a b1}
- Non-Deterministic Relaxed Contiguity output :
{a b1}, {a b2}
but example of Contiguity within looping patterns
is really hard to understand:
given the pattern : "a b+ c"
.
and the input : "a", "b1", "d1", "b2", "d2", "b3" "c"
- Strict Contiguity: {a b3 c}
- Relaxed Contiguity: {a b1 c}, {a b1 b2 c}, {a b1 b2 b3 c}, {a b2 c}, {a b2 b3 c}, {a b3 c}
- Non-Deterministic Relaxed Contiguity: {a b1 c}, {a b1 b2 c}, {a b1 b3 c}, {a b1 b2 b3 c}, {a b2 c}, {a b2 b3 c}, {a b3 c}
the Strict Contiguity output {a b3 c}
, but this is against the description in Strict Contiguity
, since there are many non-matching events
between a
and b3
.