Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

from <stream>#<window> [unidirectional]
      join <stream>#<window> [unidirectional]
[on <condition>] [within <time>]
insert [<output-type>] into <stream-name> ( {<attribute-name>}| ‘*’)

...

Following example shows a join query.

Outputs the matching events via JoinStream from last 2000 TickEvent and the NewsEvent that have arrived within 500 msec.

from TickEvent[symbol==’IBM’]#window.length(2000) join
NewsEvent#window.time(500)
insert into JoinStream *

...

Following shows a sample unidirectional join query

When an event arrives at the TickEvent that will be matched with all NewsEvents that have arrived within 500 msec, and if the TickEvent’s symbol == NewsEvent’s company, the output event will be generated and sent via JoinStream.

from TickEvent[symbol==’IBM’]#window.length(2000) as t unidirectional
join NewsEvent#window.time(500) as n
on t.symbol == n.company
insert into JoinStream *

...