I am using WSO2 CEP 4.2.0 version and I am writing an execution plan for checking when coordinates from different sensors do not vary by more than 4 meters, through Siddhi query. But getting an error: 'distance' is neither a function extension nor an aggregated attribute extension in execution plan "ExecutionPlan".
I have installed the GPL - Siddhi Geo Extension, but I do not know why there is that error. Please help me in solving this error.
My execution plan is below:
/* Enter a unique ExecutionPlan */
@Plan:name('ExecutionPlan')
/* Enter a unique description for ExecutionPlan */
-- @Plan:description('ExecutionPlan')
/* define streams/tables and write queries here ... */
@Import('SR_ProcessedStream:1.0.0')
define stream srprocessedstream (meta_resultTime long, meta_procedure string, correlation_latitude double, correlation_longitude double);
@Import('MPD_ProcessedStream:1.0.0')
define stream mpdprocessedstream (meta_resultTime long, meta_procedure string, correlation_latitude double, correlation_longitude double);
@Import('GBSS_ProcessedStream:1.0.0')
define stream gbssprocessedstream (meta_resultTime long, meta_procedure string, correlation_latitude double, correlation_longitude double);
@Export('measuredStream:1.0.0')
define stream measuredStream (meta_procedure1 string, meta_procedure2 string);
define table sensorTable(meta_procedure string, correlation_latitude double, correlation_longitude double);
from gbssprocessedstream
select meta_procedure, correlation_latitude, correlation_longitude
insert into sensorTable;
from mpdprocessedstream
select meta_procedure, correlation_latitude, correlation_longitude
insert into sensorTable;
from srprocessedstream
select meta_procedure, correlation_latitude, correlation_longitude
insert into sensorTable;
from gbssprocessedstream join sensorTable
on sensorTable.meta_procedure != gbssprocessedstream.meta_procedure and 4 > geo : distance (sensorTable.correlation_latitude, sensorTable.correlation_longitude, meta_procedure1.correlation_latitude, meta_procedure1.correlation_longitude)
select sensorTable.meta_procedure as meta_procedure1, gbssprocessedstream.meta_procedure as meta_procedure2
insert into measuredStream;
Thanks in advance!