Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Operators by category

Each operator has a page with an interactive diagram computed by Trill. It covers filtering and projection, joins, pattern detection, windows and aggregates, and the operators they build on.

Filtering and projection

OperatorWhat it does
WhereKeeps the events whose payload satisfies a predicate.
SelectTransforms each event’s payload; lifetimes are unchanged.
Select (with start time)Transforms each event’s payload using its start time as well.
SelectManyTurns each event into zero or more events with the same lifetime.
SelectByKeyTransforms each event’s payload using the stream’s key as well.
DistinctRemoves duplicates among the events alive at each moment.

Lifetimes and windows

OperatorWhat it does
AlterEventDurationGives every event a new duration, keeping its start time.
ClipEventDurationEnds each left event when a right event with the same key starts.
TumblingWindowLifetimeMoves each event into a fixed, non-overlapping window, ready for an aggregate.
HoppingWindowLifetimeMoves each event into overlapping windows of a fixed size that start every period.

Combining streams

OperatorWhat it does
UnionMerges two streams of the same type into one.
MulticastLets one query use the same input stream more than once.

Joins

OperatorWhat it does
JoinPairs left and right events with equal keys whose lifetimes overlap; each pair lives for the overlap.
LeftOuterJoinLike Join, but a left event also appears, through a separate selector, for the times when nothing matches it.
WhereNotExistsKeeps each left event only for the times when no right event with the same key is alive.

Aggregates

OperatorWhat it does
Count (tumbling window)Counts the events alive at each moment; after a tumbling window, that is a count per window.
Sum (hopping window)Sums a value over the events alive at each moment; after a hopping window, that is a sum per hop.
GroupApplySplits a stream by key, runs the same query on each group, and merges the results.

Patterns

OperatorWhat it does
DetectFinds sequences of events that match a pattern within a maximum duration.