title: What is the difference between Flink Core and Flink CEP in respect of their capabilities?
body: <p>While studying Flink CEP library over the last few days, I've been under the impression that It doesn't add any new fundamental functionality to Flink's standard capabilities. It seems like Flink CEP's only purpose is to make event processing easier, with clear semantics and intuitive code structure. As an example, Flink CEP presents only <a href="https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/libs/cep.html#after-match-skip-strategy" rel="nofollow noreferrer">5 semantics</a> of event match skipping. Although these semantics may be enough for a great range of cases, it may not solve specific problems, which makes us return to plain Flink.</p>
  
  <p>A test case is the following pattern : </p>
  
  <p><code>Emmit a alert(represented by 'a') for each non-overlapping pair of numbers in a stream</code></p>
  
  <p>Represented by the pattern:</p>
  
  <p><code>Pattern.begin[EventType]("pair",skipStrategy).where(new AlwaysTrueFunction()).times(2)</code></p>
  
  <p>So, for a input like (numbers entering from left to right on the stream) <code>1 1 1 1 1</code>, the expected output would be <code>a a</code>, but none of the 5 match skipping strategies would give the right result:</p>
  
  <pre><code>No-skip: a a a a
  Skip-to-next: a a a a
  Skip-past-last-event: a a a a
  Skip-to-first[1]: a a a a
  Skip-to-last[1]: a a a a
  </code></pre>
  
  <p>Although these strategies can't generate the desired pattern, It could be easily made using a <code>RichFunction</code> with a <code>ValueState</code> counter to determine when a new alert should be emmited, transforming the input stream in a stream of events. </p>
  
  <p>Thus, I would appreciate some light over these questions:</p>
  
  <ul>
  <li><p>Why was CEP library created if Flink seems to be more complete?</p></li>
  <li><p>A pattern made with CEP is more efficient(greater throughput/other metric) than one made with  Flink standard DataStream operators?(if possible, with some links provided for articles/papers/documentation about this)</p></li>
  </ul>