Hi Federico, If I understand your question correctly, then yes, the application of a Pattern on a keyed stream is similar to the application of a map function.
It will search for the pattern on each per-key stream of data. So there will be state (buffer with partial matches, queued elements, etc) for every active key. Cheers, Kostas > On Oct 19, 2017, at 11:55 AM, Federico D'Ambrosio > <federico.dambro...@smartlab.ws> wrote: > > Hi all, > > I was wondering if it is correct to assume the application of a pattern on a > KeyedStream similar to the application, e.g., of a MapFunction when it comes > to state. > > For example, the following > > val pattern = ... > val keyedStream = stream.keyBy("id") > > val patternKeyedStream = CEP.pattern(pattern, keyedStream) > > val anotherKeyedStream = patternKeyedStream.select(...) > > should only check the pattern on each single partition value. > > Am I correct in assuming this, or I have misunderstood CEP functioning? > > -- > Federico D'Ambrosio