TL; DR
我试图创建一个Esper查询:
Esper查询:
// Schema for IncomingRoomTemperatures:
// double temperatureCelsius
// string roomDescription
// Intent: Input from Java.
CREATE WINDOW RoomTempaturesThrottled.std:unique(roomDescription)
as SELECT * FROM IncomingRoomTemperature;
INSERT INTO RoomTempaturesThrottled
SELECT
*
FROM IncomingRoomTemperature r
WHERE r.temperatureCelsius >= 35;
// Intent: Output to Java.
@Name('room-temperatures-throttled')
SELECT * FROM RoomTempaturesThrottled
OUTPUT SNAPSHOT EVERY 10 SECONDS;
答案 0 :(得分:1)
没有比这更需要的了:
// react if any room's temperature rises above 35 degrees celsius.
SELECT * FROM IncomingRoomTemperature(temperatureCelsius >= 35)