使用 wso2 CEP 处理空值 [英] Handling null values with wso2 CEP

查看:10
本文介绍了使用 wso2 CEP 处理空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用其中一列不为空的附加条件来更新事件表 (RDBMS).表名为 MSISDNProfileDB,在 oracle db 中.

I want to update event table (RDBMS) using additional condition that one column in that is not null. Table name is MSISDNProfileDB and it's in oracle db.

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 中删除数据.

it validates the code, but does not update INTERACTION_DT. For testing purposes, I changed it to check if the column is null, and manually remove data from 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 并执行此操作时:

...and it still doesnt work. But when I change column value to 1 and do this:

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 的空值问题.有谁知道如何处理空值?

it works! So, conclusion is that cep has problem with null values from oracle db. Does anyone knows how are null values handled?

亲切的问候,斯蒂芬

推荐答案

我在 MySQL 中遇到了类似的问题.问题似乎在于 CEP 将 Siddhi 查询解析为 SQL 的方式.我为此做了一个快速的 修复,它适用于我的场景.它也应该适用于您的情况,但尚未使用 Oracle 进行测试.使用修复(假设您使用的是 CEP 4.2.0);

I came across a similar problem with MySQL. The issue seems to be in the way CEP parse Siddhi query into SQL. I did a quick 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. /repository/components/plugins/ 目录中删除 siddhi-extension-event-table_3.1.2.jar.

编译后的jar添加到<cep>/repository/components/lib/ 目录.

使用以下查询;

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

这篇关于使用 wso2 CEP 处理空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆