【报错详情】
java.lang.RuntimeException: RowTime field should not be null, please convert it to a non-null long value.
at org.apache.flink.table.runtime.operators.wmassigners.WatermarkAssignerOperator.processElement(WatermarkAssignerOperator.java:115) ~[flink-table-blink_2.11-1.13-vvr-4.0.14-2-SNAPSHOT.jar:1.13-vvr-4.0.14-2-SNAPSHOT]
at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask$StreamTaskNetworkOutput.emitRecord(OneInputStreamTask.java:205) ~[flink-dist_2.11-1.13-vvr-4.0.14-2-SNAPSHOT.jar:1.13-vvr-4.0.14-2-SNAPSHOT]
at org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.processElement(AbstractStreamTaskNetworkInput.java:135) ~[flink-dist_2.11-1.13-vvr-4.0.14-2-SNAPSHOT.jar:1.13-vvr-4.0.14-2-SNAPSHOT]
at org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.emitNext(AbstractStreamTaskNetworkInput.java:106) ~[flink-dist_2.11-1.13-vvr-4.0.14-2-SNAPSHOT.jar:1.13-vvr-4.0.14-2-SNAPSHOT]
【报错原因】
生成Watermark的Event time时间字段中存在NULL值脏数据。
【解决方案】
使用计算列过滤脏数据,代码示例如下。
ts as case when `datetime` is null
then to_timestamp('1970-01-01 00:00:00')
else `datetime`end