THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
So a cumulating window for 1 hour step and 1 day max size will produce wndows: [00:00, 01:00), [00:00, 02:00), [00:00, 03:00), ..., [00:00, 24:00)
for every day.
Here is an example invocation on the Bid table:
Code Block | ||
---|---|---|
| ||
> SELECT * FROM TABLE( CUMULATE(TABLE Bid, DESCRIPTOR(bidtime), INTERVAL '52' MINUTES, INTERVAL '10' MINUTES)); ------------------------------------------------------ | bidtime | price | item | window_start | window_end | ------------------------------------------------------ | 8:07 | $2 | A | 8:00 | 8:08 | | 8:07 | $2 | A | 8:00 | 8:10 | | 8:11 | $3 | B | 8:10 | 8:12 | | 8:11 | $3 | B | 8:10 | 8:14 | | 8:11 | $3 | B | 8:10 | 8:16 | | 8:11 | $3 | B | 8:10 | 8:18 | | 8:11 | $3 | B | 8:10 | 8:20 | | 8:05 | $4 | C | 8:00 | 8:06 | | 8:05 | $4 | C | 8:00 | 8:08 | | 8:05 | $4 | C | 8:00 | 8:10 | | 8:09 | $5 | D | 8:00 | 8:10 | | 8:13 | $1 | E | 8:10 | 8:14 | | 8:13 | $1 | E | 8:10 | 8:16 | | 8:13 | $1 | E | 8:10 | 8:18 | | 8:13 | $1 | E | 8:10 | 8:20 | | 8:17 | $6 | F | 8:10 | 8:18 | | 8:17 | $6 | F | 8:10 | 8:20 | ------------------------------------------------------ > SELECT window_start, window_end, SUM(price) FROM TABLE( CUMULATE(TABLE Bid, DESCRIPTOR(bidtime), INTERVAL '52' MINUTES, INTERVAL '10' MINUTES)) GROUP BY window_start, window_end; -------------------------------------- | window_start | window_end | price | -------------------------------------- | 8:00 | 8:06 | $4 | | 8:00 | 8:08 | $6 | | 8:00 | 8:10 | $11 | | 8:10 | 8:12 | $3 | | 8:10 | 8:14 | $4 | | 8:10 | 8:16 | $4 | | 8:10 | 8:18 | $10 | | 8:10 | 8:20 | $10 | -------------------------------------- |
...