How to sort a stream by event time using Flink SQL

The problem turned out to be using timestamp as a field name in my Event class. Changing it to eventTime was enough to get everything working: public class Sort { public static final int OUT_OF_ORDERNESS = 1000; public static void main(String[] args) throws Exception { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); StreamTableEnvironment tableEnv = TableEnvironment.getTableEnvironment(env); env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime); env.setParallelism(1); … Read more