WSO2CEP SiddhiQL-如何将属性从一个流插入到另一个流

WSO2CEP SiddhiQL-如何将属性从一个流插入到另一个流,wso2,wso2cep,siddhi,Wso2,Wso2cep,Siddhi,我正在使用WSO2 CEP,并创建了以下执行计划: define stream sensor1Stream (timestamp string, id string, latitude double, longitude double, altitude double); define stream sensor2Stream (timestamp string, id string, latitude double, longitude double, altitude double

我正在使用WSO2 CEP,并创建了以下执行计划:

  define stream sensor1Stream (timestamp string, id string, latitude double, longitude double, altitude double);

  define stream sensor2Stream (timestamp string, id string, latitude double, longitude double, altitude double);

  define stream alertStream (alert_id bool, alert_level string, accuracy_level string, s1_timestamp string, s1_id string, s1_latitude double, s1_longitude double, s1_altitude double, s2_timestamp string, s2_id string, s2_latitude double, s2_longitude double, s2_altitude double);

    from sensor1Stream
    select timestamp as s1_timestamp, id as s1_id, latitude as s1_latitude, longitude as s1_longitude, altitude as s1_altitude
    insert into alertStream(s1_timestamp, s1_id, s1_latitude, s1_longitude, s1_altitude);

    from sensor2Stream
    select timestamp as s2_timestamp, id as s2_id, latitude as s2_latitude, longitude as s2_longitude, altitude as s2_altitude
    insert into alertStream(s2_timestamp, s2_id, s2_latitude, s2_longitude, s2_altitude);
我想在alertStream中插入sensor1Stream和sensor2Stream的属性。我已尝试了上述方法,但由于错误而无效:

“您的SiddhiQL在第39:23行有一个错误,无关输入 “('应为{,';'}”

错误在alertStream和执行计划最后一行的括号之间

我不知道我做错了什么。如果有人能在这件事上帮助我,我将不胜感激


谢谢!

请在下面找到一个Siddhi执行计划的示例:

@Plan:name('ExecutionPlan')

@Import('org.wso2.event.sensor.stream:1.0.0')
define stream sensor_stream (meta_timestamp long, meta_isPowerSaverEnabled bool, meta_sensorId int, meta_sensorName string, correlation_longitude double, correlation_latitude double, humidity float, sensorValue double);

@Export('org.wso2.sensor.value.projected.stream:1.0.0')
define stream sensor_value_projected_stream (meta_sensorId int, correlation_longitude double, correlation_latitude double, humidity float, value double);

from sensor_stream
select meta_sensorId, correlation_longitude, correlation_latitude, humidity, sensorValue as value
insert into sensor_value_projected_stream;
此示例取自Siddhi示例“”


您可以参考WSO2 CEP文档页面。提供了有关Siddhi语言的完整参考。

Hi!非常感谢您的回复!我基于您的示例,删除了“插入alertStream”中括号中的属性。但是现在发生了一个新错误。我已经在下面两个注释中发布了错误。您能帮我解决它吗?谢谢!“与输出流定义相同的不同定义:StreamDefinition{id='alertStream',attributeList=[Attribute{id='s1_timestamp',type=STRING},Attribute{id='s1 id',type=STRING},Attribute{id='s1_lation',type=DOUBLE},Attribute{id='s1_lation',type=DOUBLE},Attribute{id='s1_lation',type=DOUBLE},attributeList=[Attribute{id='alert_id',type=BOOL},Attribute{id='alert_level',type=STRING},Attribute id='accurity_level type=STRING},Attribute{id='s1_-timestamp',type=STRING},Attribute{id='s1_-id',type=STRING},Attribute{id='s1_-latitude',type=DOUBLE},Attribute{id='s1_-lation',type=DOUBLE},Attribute{id='s2_-timestamp',type=STRING},Attribute id='s2_-id',type=STRING},Attribute id='s2_-latitude',type=DOUBLE},Attribute id='s2_-latitude},Attribute执行计划中的{id='s2_longitude',type=DOUBLE},属性{id='s2_altitude',type=DOUBLE}],注释=[]}”您好,这是因为
select
语句必须包含alertStream所有属性的值。由于alertStream有13个属性,
select
语句必须有13个值;当前只有5个值。