Hi Krzysztof,
first of all Flink does not sort events based on timestamp. The concept
of watermarks just postpones the triggering of a time operation until
the watermark says all events until a time t have arrived.
For your problem, you can simply use a ProcessFunction and buffer the
events in state until some condition is met. Once the condition is met,
you sort the data and emit what is allowed to be emitted.
You can also take a look at how Flink SQL's event time sort is
implemented. Maybe not the easiest implementation but useful for
understanding the concepts of time and state.
org.apache.flink.table.runtime.aggregate.RowTimeSortProcessFunction
I hope this helps.
Timo
On 10.12.19 17:15, KristoffSC wrote:
> Hi,
> Is it possible to use an field that does not represent timestamp to order
> events in Flink's pipeline?
>
> In other words, I will receive a stream of events that will ha a sequence
> number (gaps are possible).
> Can I maintain the order of those events based on this field same as I would
> do for time representing field?
>
> Regards,
> Krzysztof
>
>
>
> --
> Sent from:
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/>