To perform a join with a database table and get data out of it, we must have a stream event triggered. You can trigger an event by calling an exposed HTTP source [1] , or with a start trigger [2] (which executes at the start of the Siddhi app). Then you can send that event to a stream, join it with a table, and calculate the average.
define trigger StartTrigger at 'start';
@source(type='http', receiver.url=... )
define stream HttpInputStream(...);
from StartTrigger
-- or
-- from HttpInputStream
select *
insert into JoinStream;
-- Join `JoinStream` with database table, then calculate the avg
Thanks,
Senthuran.