This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE PUMP "STREAM_PUMP_SPEED" AS | |
INSERT INTO "SPEED_SQL_STREAM" | |
SELECT STREAM | |
"uniqueId", | |
AVG("speed") over W0, | |
AVG("speed") over W2, | |
AVG("speed") over W10 | |
FROM "INCOMING_STREAM" | |
WINDOW | |
W0 AS ( PARTITION BY "uniqueId" | |
RANGE INTERVAL '0' MINUTE PRECEDING), | |
W2 AS ( PARTITION BY "uniqueId" | |
RANGE INTERVAL '2' MINUTE PRECEDING), | |
W10 AS ( PARTITION BY "uniqueId" | |
RANGE INTERVAL '10' MINUTE PRECEDING); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment