The structure of CQL queries is very similar to that of SQL. In fact, CQL is based on a subset of SQL99. Let's revisit the simple example from the beginning of the previous section:
SELECT p1 FROM inputChannel
In this case, the FROM inputChannel
clause informs the query that the input events arrive from the source called inputChannel
, which happens to be the upstream channel to this CQL processor in the EPN. Further, the SELECT p1
clause states that the query is selecting only the event property p1
for output. The behavior of this query is best described with the following table:
Timet |
Input event |
Output event |
---|---|---|
|
|
|
In other words, at time t = 0
, we receive event {p1 = 1, p2 = "hi"}
and output event {p1 = 1}
. For the time being, ignore the time-related aspect of processing.
Here is a slightly more complicated case:
SELECT p2 FROM inputChannel WHERE p1 = 1
In this second query, we make use of a WHERE
clause....