wso2cep: 错误 - 'distance' 既不是函数扩展也不是执行计划中的聚合属性扩展 "ExecutionPlan"
wso2cep: ERROR - 'distance' is neither a function extension nor an aggregated attribute extension in execution plan "ExecutionPlan"
我正在使用 WSO2 CEP 4.2.0 版本,我正在编写一个执行计划,用于通过 Siddhi 查询检查来自不同传感器的坐标何时变化不超过 4 米。但是报错:'distance' is neither a function extension nor an aggregated attribute extension in execution plan "ExecutionPlan".
我已经安装了GPL - Siddhi Geo Extension,但是我不知道为什么会出现那个错误。请帮我解决这个错误。
我的执行计划如下:
/* 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;
提前致谢!
distance
is Function extension (in contrast to Stream Processor extension type). Please refer Siddhi Extensions 文档显示了每种类型的用法。
如上述文档所述,必须在 select
语句上应用函数扩展。出现此错误是因为函数扩展应用于其他地方(在 join
条件中)。
问题在于 official installation instructions 提供的已编译的 p2-repo 不是最新的并且 缺失下面的距离函数是一个带有相关jar文件的图像
要使用此功能,您需要 build the p2-repo 并安装它,它应该可以使用!编译所有三个项目后,您应该在目录 wso2-gpl/carbon-event-processing-extensions/repository/target
中看到 p2-repo
希望对您有所帮助!
我正在使用 WSO2 CEP 4.2.0 版本,我正在编写一个执行计划,用于通过 Siddhi 查询检查来自不同传感器的坐标何时变化不超过 4 米。但是报错:'distance' is neither a function extension nor an aggregated attribute extension in execution plan "ExecutionPlan".
我已经安装了GPL - Siddhi Geo Extension,但是我不知道为什么会出现那个错误。请帮我解决这个错误。
我的执行计划如下:
/* 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;
提前致谢!
distance
is Function extension (in contrast to Stream Processor extension type). Please refer Siddhi Extensions 文档显示了每种类型的用法。
如上述文档所述,必须在 select
语句上应用函数扩展。出现此错误是因为函数扩展应用于其他地方(在 join
条件中)。
问题在于 official installation instructions 提供的已编译的 p2-repo 不是最新的并且 缺失下面的距离函数是一个带有相关jar文件的图像
要使用此功能,您需要 build the p2-repo 并安装它,它应该可以使用!编译所有三个项目后,您应该在目录 wso2-gpl/carbon-event-processing-extensions/repository/target
希望对您有所帮助!