I've read the definition here https://docs.aws.amazon.com/kinesisanalytics/latest/sqlref/sql-reference-monotonic-expressions-operators.html, however it's still unclear to me. I understand that monotonic means ascending or descending. Does that mean that a monotonic column is ascending, descending, strictly ascending, or strictly descending? Does it have to be unique or can it contain duplicates?
The context of this question is that I tried use an ORDER BY
in a WINDOW
based on a TIMESTAMP
, but I got the error The leading column of an ORDER BY statement must be monotonic
(which I thought TIMESTAMPS were).
Example:
WINDOW fifteenSecondWindow as (
PARTITION BY "peerId" (none unique)
ORDER BY "emissionTime" (is unique for each partition of peers, but may not be globally unique)
RANGE INTERVAL '15' SECOND PRECEDING
);