Range, Rows, and Slide at Query Start-Up and for Empty Relations The descriptions

Introduction to Oracle CQL 1-11 ■ Range-Based Stream-to-Relation Window Operators on page 4-6 ■ Tuple-Based Stream-to-Relation Window Operators on page 4-13 ■ Partitioned Stream-to-Relation Window Operators on page 4-18 ■ Section 1.1.11, Functions ■ Section 19.1.3.5, Using count With , identifier., and identifier.attr

1.1.3.2 Partition

The keyword Partition By logically separates an event stream S into different substreams based on the equality of the attributes given in the Partition By specification. For example, the S[Partition By A,C Rows 2] partition specification creates a sub-stream for every unique combination of A and C value pairs and the Rows specification is applied on these sub-streams. The Rows specification indicates I want to look at 2 tuples worth of data. For more information, see Section 1.1.3.1, Range, Rows, and Slide .

1.1.3.3 Default Stream-to-Relation Operator

When you reference a stream in an Oracle CQL query where a relation is expected most commonly in the from clause, a Range Unbounded window is applied to the stream by default. For example, the queries in Example 1–8 and Example 1–9 are identical: Example 1–8 Query Without Stream-to-Relation Operator query id=q1[CDATA[ select from InputChannel ]]query Example 1–9 Equivalent Query query id=q1[CDATA[ IStreamselect from InputChannel[RANGE UNBOUNDED] ]]query For more information, see Section 1.1.4, Relation-to-Stream Operators .

1.1.4 Relation-to-Stream Operators

You can convert the result of a stream-to-relation operation back into a stream for further processing. In Example 1–10 , the select will output a stream of tuples satisfying the filter condition viewq3.ACCT_INTRL_ID = ValidLoopCashForeignTxn.ACCT_INTRL_ID. The now window converts the viewq3 into a relation, which is kept as a relation by the filter condition. The IStream relation-to-stream operator converts the output of the filter back into a stream. Example 1–10 Relation-to-Stream Operation processor namecqlProcessorname rules query id=q3Txns[CDATA[ IStream select 1-12 Oracle Complex Event Processing CQL Language Reference TxnId, ValidLoopCashForeignTxn.ACCT_INTRL_ID, TRXN_BASE_AM, ADDR_CNTRY_CD, TRXN_LOC_ADDR_SEQ_ID from viewq3[NOW], ValidLoopCashForeignTxn where viewq3.ACCT_INTRL_ID = ValidLoopCashForeignTxn.ACCT_INTRL_ID ]]query rules processor Oracle CQL supports the following relation-to-stream operators: ■ IStream: insert stream. IStreamR contains all r,T where r is in R at time T but r is not in R at time T-1. For more information, see IStream Relation-to-Stream Operator on page 4-24. ■ DSteam: delete stream. DStreamR contains all r,T where r is in R at time T-1 but r is not in R at time T. For more information, see DStream Relation-to-Stream Operator on page 4-25. ■ RStream: relation stream. RStreamR contains all r,T where r is in R at time T. For more information, see RStream Relation-to-Stream Operator on page 4-26. By default, Oracle CEP includes an operation indicator in the relations it generates so you can identify insertions, deletions, and, when using UPDATE SEMANTICS, updates. For more information, see Section 1.1.1.3, Relations and Oracle CEP Tuple Kind Indicator .

1.1.4.1 Default Relation-to-Stream Operator

Whenever an Oracle CQL query produces a relation that is monotonic, Oracle CQL adds an IStream operator by default. A relation R is monotonic if and only if Rt1 is a subset of Rt2 whenever t1 = t2. Oracle CQL use a conservative static monotonicity test. For example, a base relation is monotonic if it is known to be append-only: S[Range Unbounded] is monotonic for any stream S; and the join of two monotonic relations is also monotonic. If a relation is not monotonic for example, it has a window like S[range 10 seconds], it is impossible to determine what the query author intends IStream, DStream, or RStream, so Oracle CQL does not add a relation-to-stream operator by default in this case.

1.1.5 Stream-to-Stream Operators

Typically, you perform stream to stream operations using the following: ■ A stream-to-relation operator to turn the stream into a relation. For more information, see Section 1.1.3, Stream-to-Relation Operators Windows .