Top
Interstage Big DataComplex Event Processing Server V1.1.0 Developer's Reference
FUJITSU Software

1.2.2 FROM Clause

For the FROM clause, specify one or more event streams or named windows as the input.

Syntax:

from eventStreamDefinition [as name] [unidirectional] [retain-union | retain-intersection]
[,eventStreamDefinition [as name]] [, ...]

The eventStreamDefinition is a filter-based event stream definition or a pattern-based event stream definition. For AS, a name (alias) can be attached to a stream definition.

Refer to "1.2.11 JOIN Clause" for information on UNIDIRECTIONAL.

Note

Notes on using Virtual Data Windows

For a simple SELECT statement that specifies Virtual Data Window in a FROM clause or a join that does not specify UNIDIRECTIONAL, an event inserted into the Virtual Data Window by the INSERT INTO clause using the complex event processing rules on the same CEP engine propagates. However, an event (cache entry) added from a Terracotta application or a different CEP engine does not propagates. To access cache data, use an ON SELECT statement, a subquery, or a join that specifies UNIDIRECTIONAL.

The following example shows a simple SELECT statement:

select W.high, W.low from MarketWindow;

The following example shows a join that does not specify UNIDIRECTIONAL:

select W.high, W.low from TicketEvent.std:lastevent() as Input, MarketWindow as W
where W.code = Input.code;

If the INSERT INTO clause inserts an event into MarketWindow, the inserted event is reported to the SELECT statements. However, events added outside the CEP engine are not reported.

1.2.2.1 Filter-based Event Stream Definition

Syntax:

eventStreamName [( filterCondition )] [.view] [.view]

The eventStreamName is an event type name, an event stream name specified in the INSERT INTO clause of a different complex event processing statement, or the name of a named window.

For the filterCondition specification, use properties and operators, functions (except for the aggregate function), or similar, to describe the condition. Commas (,) can be used in a filterCondition with the same meaning as the AND logical operator.

In addition, event expiry policy specifications (if a data window view) and data derivations can be specified by specifying a view, as described at "1.7 Views".

If more than one view is specified, the common parts of those views are retained by default (same as the RETAIN-INTERSECTION specification). The union parts of multiple views can be retained by specifying RETAIN-UNION.

1.2.2.2 Pattern-based Event Stream Definition

Syntax:

pattern [ patternExpression ] [.view] [.view]

Pattern-based event streams are specified by describing a patternExpression inside square brackets, "[" and "]", following the PATTERN keyword. A view can also be specified for a pattern in the same way as for filter-based event stream definitions.

Refer to "1.4 Patterns" for information on how to describe a patternExpression.