我使用艾斯波(事件處理引擎),英超查詢:艾斯波:「time_order」似乎不工作
select * from Event.ext:time_order(timestamp_event, 10000 minutes) where duration > 10
但輸出不受「timestamp_event」下令:
id int = 1, timestamp_event= 1412686800000, duration = 30
id int = 4, timestamp_event= 1412685900000, duration = 70
id int = 2, timestamp_event= 1412688600000, duration = 45
id int = 3, timestamp_event= 1412689500000, duration = 60
id int = 5, timestamp_event= 1412636400000, duration = 15
爲什麼「time_order(timestamp_event,10000分鐘)」指令不起作用?
我認爲這個問題是埃斯佩爾配置,讓我們考慮一個簡單的查詢:
select * from Event.win:time(10 sec) order by id_event
這是UpdateListener的「upate」方法的代碼:
public void update(EventBean[] newEvents, EventBean[] oldEvents) {
EventBean event = newEvents[0];
System.out.println("id int = " + event.get("id_event") + ", timestamp_event = " + ((Long)event.get("timestamp_event")).toString());
但產量不是由「id_event」命令!
id event = 1, timestamp_event = 1412686800000
id event = 4, timestamp_event = 1412687700000
id event = 2, timestamp_event = 1412687100000
id event = 3, timestamp_event = 1412687400000
id event = 5, timestamp_event = 1412688000000
看來既不是「order by」指令不起作用,它怎麼可能?
添加「rstream」的輸出是一樣的,有沒有辦法通過時間戳傳遞給Esper有序事件? – paolo789 2014-10-11 09:18:29
你爲什麼不回顧time_order的迴歸測試,看看你的代碼和迴歸代碼的不同之處。鏈接是http://svn.codehaus.org/esper/esper/trunk/esper/src/test/java/com/espertech/esper/regression/view/TestViewTimeOrder.java – user650839 2014-10-13 15:32:50