I have a stream in which the records arrive in order. I apply a map function and then keyBy function on it. Will the order of the records be maintained within each stream of records with the same key?
There was a similar question in Ordering of Records in Stream. But I am confused between the answer given there and the below description copied from the link "https://ci.apache.org/projects/flink/flink-docs-release-1.2/concepts/programming-model.html".
" In a redistributing exchange the ordering among the elements is only preserved within each pair of sending and receiving subtasks (for example, subtask[1] of map() and subtask[2] of keyBy/window). So in this example, the ordering within each key is preserved, but the parallelism does introduce non-determinism regarding the order in which the aggregated results for different keys arrive at the sink."
In the example given, subtask[2] of keyBy receives elements from both subtask[1] and subtask[2] of map. How does the ordering within each key get preserved if the ordering is maintained only between subtasks?