The IEP operators enable you to define the logic in an event processor.
Most of the IEP operators take a stream or a relation as input and produce a stream or a relation as output.
A schema defines the types of information that a set of data contains. A schema consists of one or more attributes. Each attribute is identified by a name and has a data type that specifies the allowed values.
For example, a schema could consist of the following attributes:
An attribute called Symbol that allows character values of between 1 and 10 characters
An attribute called Price that allows floating-point values
A stream is a series of timestamped events that have the same schema.
Assume that a stream has the following characteristics:
Each event represents a stock transaction.
The schema consists of the stock symbol and the stock price.
The following table shows an example of the events in the stream during a brief interval of time.
Symbol |
Price |
Timestamp |
---|---|---|
ADBE |
21.60 |
2008-12-15-T10:30:02:899-05.00 |
AMZN |
50.12 |
2008-12-15-T10:32:44:674-05.00 |
ATT |
23.88 |
2008-12-15-T10:35:17:198-05.00 |
ADBE |
21.70 |
2008-12-15-T10:38:23:257-05.00 |
A relation is a collection of events that match a user-defined condition at a point in time.
You can define the condition in various ways. For example:
All events that arrived in the last five seconds
All events that arrived in the last five hours
The most recent two events
Assume that you define the condition as all events that arrived in the last five seconds. For the example in Understanding Streams, the relation at time 2008-12-15-T10:35:00:000-05.00 would consist of the following events.
Symbol |
Price |
Timestamp |
---|---|---|
ADBE |
21.60 |
2008-12-15-T10:30:02:899-05.00 |
AMZN |
50.12 |
2008-12-15-T10:32:44:674-05.00 |
Let's move forward one second in time. The relation at time 2008-12-15-T10:36:00:000-05.00 would consist of the following events. Compared with the previous relation, one event has dropped out and one event has been added.
Symbol |
Price |
Timestamp |
---|---|---|
AMZN |
50.12 |
2008-12-15-T10:32:44:674-05.00 |
ATT |
23.88 |
2008-12-15-T10:35:17:198-05.00 |
The relation at time 2008-12-15-T10:37:00:000-05.00 would consist of the following events. This relation has the same events as the previous relation.
Symbol |
Price |
Timestamp |
---|---|---|
AMZN |
50.12 |
2008-12-15-T10:32:44:674-05.00 |
ATT |
23.88 |
2008-12-15-T10:35:17:198-05.00 |
The relation at time 2008-12-15-T10:38:00:000-05.00 would consist of the following events. Compared with the previous relation, one event has dropped out.
Symbol |
Price |
Timestamp |
---|---|---|
ATT |
23.88 |
2008-12-15-T10:35:17:198-05.00 |
The relation at time 2008-12-15-T10:39:00:000-05.00 would consist of the following events. Compared with the previous relation, one event has been added.
Symbol |
Price |
Timestamp |
---|---|---|
ATT |
23.88 |
2008-12-15-T10:35:17:198-05.00 |
ADBE |
21.70 |
2008-12-15-T10:38:23:257-05.00 |
A relation can be empty. For the example in Understanding Streams, the relation at time 2008-12-15-T10:45:00:000-05.00 would not contain any events because none of the events arrived in the last five seconds.
In the property editor of an IEP operator, you can assign any of the following data types to an attribute:
INTEGER
BIGINT
DOUBLE
VARCHAR
DATE
TIMESTAMP
The Size and Scale columns are disabled for the DATE and TIMESTAMP data types.
You must ensure that input and output data types are appropriately matched.
You can categorize the IEP operators by their input and outputs.
Stream to Relation. Operators that take a stream as input, and produce a relation as output with the same schema as the stream.
Relation to Stream. Operators that take a relation as input, and produce a stream as output with the same schema as the relation.
Relation to Relation. Operators that take one or more relations as input, and produce a relation as output.
Stream to Stream. Operators that take a stream as input, and produce a stream as output. The input stream and the output stream can have different schemas.
Relation to Table. Operators that take a relation as input, and produce a table as output.
For specific information about each IEP operator, see the following topics: