解决 : 设置时间语义,flink有三种时间语义 Event Time,Processing Time,Ingestion Time
设置
StreamExecutionEnvironment environment = StreamExecutionEnvironment.getExecutionEnvironment();
设置下,下面这个代码。
environment.setStreamTimeCharacteristic(TimeCharacteristic.ProcessingTime);