In the documentation provided by AWS they provide examples for doing tumbling and sliding windows based on the ROWTIME which is the timestamp when Amazon Kinesis Analytics inserted the row in the first in-application stream.
The provided example:
Tumbling window
GROUP BY Ticker_Symbol,
STEP("INCOMING_STREAM".ROWTIME BY INTERVAL '60' SECOND);
I want to use my own timestamp for doing this windowing. In my case the field is called "recordTimeStamp".
I defined it as a timestamp:
CREATE OR REPLACE STREAM "INCOMING_STREAM" (
"uniqueId" INTEGER,
"speed" INTEGER,
"bezettingsgraad" INTEGER,
"recordTimestamp" TIMESTAMP);
When looking at the "INCOMING_STREAM" I see the timestamp formag eg. 2020-05-03 20:18:36.0
.
However, when rewriting above statements to work with my own "recordTimestamp" I get the message:
Cannot aggregate an infinite stream: GROUP BY clause is not specified or does not contain any monotonic expressions.
Tumbling window
GROUP BY Ticker_Symbol,
STEP("INCOMING_STREAM"."recordTimestamp" BY INTERVAL '60' SECOND);
How can I fix this or perhaps indicate that my "recordTimestamp" field is monotonicly increaing