Re: [Flink] How to Converting DataStream<Row> to Dataset or Table?
Hi Richard,
in general it is difficult to sort a DataStream that is
potentially neverending. However, if you use Flink's event-time
semantics with watermarks that indicate that you stream is
complete until a certain point you can sort it. The Table API will
offer a a sort option in 1.4
(https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/table/sql.html#orderby--limit)
based on that. The easiest way to implement a sort is to buffer
the records in state and sort them when you think it is reasonable
to sort them, you can use a ProcessFunction for that.