使用 wso2 CEP 处理空值

Handling null values with wso2 CEP

我想使用附加条件更新事件 table (RDBMS),其中的一列不为空。 Table 名称是 MSISDNProfileDB,它在 oracle 数据库中。

from incomingStream#window.length(1)
select  correlation_MSISDN as MSISDN, 
        INTERACTION_DT as INTERACTION_DT
update MSISDNProfileDB
on MSISDNProfileDB.MSISDN == MSISDN
and not(MSISDNProfileDB.column1 is null);

它验证代码,但不更新 INTERACTION_DT。出于测试目的,我将其更改为检查该列是否为空,并手动从 column1 中删除数据。

from incomingStream#window.length(1)
select  correlation_MSISDN as MSISDN, 
        INTERACTION_DT as INTERACTION_DT
update MSISDNProfileDB
on MSISDNProfileDB.MSISDN == MSISDN
and MSISDNProfileDB.column1 is null;

...它仍然不起作用。但是当我将列值更改为 1 并执行此操作时:

from incomingStream#window.length(1)
select  correlation_MSISDN as MSISDN, 
        INTERACTION_DT as INTERACTION_DT
update MSISDNProfileDB
on MSISDNProfileDB.MSISDN == MSISDN
and MSISDNProfileDB.column1 == '1';

有效!因此,结论是 cep 对来自 oracle db 的空值有问题。有谁知道如何处理空值?

亲切的问候, 斯特凡

我遇到了与 MySQL 类似的问题。问题似乎在于 CEP 将 Siddhi 查询解析为 SQL 的方式。我快速 fix for that, and it worked for my scenario. It should work in your case too, but haven't tested with Oracle though. To use the fix (assuming you are using CEP 4.2.0);

  1. <cep>/repository/components/plugins/ 目录中删除 siddhi-extension-event-table_3.1.2.jar

  2. compiled jar 添加到 <cep>/repository/components/lib/ 目录。

  3. 使用以下查询;

    from incomingStream
    select  
        correlation_MSISDN as MSISDN, 
        INTERACTION_DT as INTERACTION_DT
    update MSISDNProfileDB
    on MSISDNProfileDB.MSISDN == MSISDN and not (MSISDNProfileDB.column1 is null);