问题描述
我想使用其他条件更新事件表(RDBMS),因为其中的一列不为null.表名是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);
-
从
<cep>/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处理空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!