1

我正在尝试创建一个 EPL 语句,以显示订单是否成功。

该声明应根据购买的 ID 将购买与付款相匹配。结果应包含购买的 ID 和一个布尔值,该值指示购买是否与付款匹配。

当匹配成功时,我得到了下面的语句来返回 true。但是,当购买退出 30 秒时间窗口而没有与付款匹配时,我也想返回 false。

SELECT Purchase.purchaseId AS purchaseId, true AS successful
FROM Purchase.win:time(30), Payment.win:time(30) 
WHERE Purchase.purchaseId = Payment.purchaseId

如果事件的顺序无关紧要,那也很好。例如,如果在购买之前付款。

4

1 回答 1

1

请改用外连接。

像这样的东西:

SELECT Purchase.purchaseId AS purchaseId, s2 is not null as successfull
FROM Purchase.win:time(30) as s1 left outer join Payment.win:time(30) as s2
on s1.purchaseId = s2.purchaseId
于 2013-02-05T13:22:58.710 回答