没记错这是一个bug,计算列中含有关键字会异常,可以看下这个issue:
https://issues.apache.org/jira/browse/FLINK-16068

Robin Zhang <vincent2015q...@outlook.com> 于2020年12月29日周二 下午6:56写道:

> -- 定义时间非系统保留字为事件时间字段,能正常运行
> create table events (
>     process_time          bigint  comment '事件时间',
>     event           string  comment '事件类型',
>     ts AS TO_TIMESTAMP(FROM_UNIXTIME(process_time/1000, 'yyyy-MM-dd
> HH:mm:ss')),
>     WATERMARK FOR ts AS ts - INTERVAL '5' SECOND
> ) with (
>   ... ...
> );
>
> 但是,定义的字段是系统保留字时,就会报错:
> create table events (
>     `time`  bigint  comment '事件时间',
>      event    string  comment '事件类型',
>     ts AS TO_TIMESTAMP(FROM_UNIXTIME(`time`/1000, 'yyyy-MM-dd HH:mm:ss')),
>     WATERMARK FOR ts AS ts - INTERVAL '5' SECOND
> ) with (
>   ... ...
> );
>
> 但现在问题是:神策埋点的事件时间字段是time,如果单独写一个程序转换字段的话,显得有些鸡肋。
> 不知道是不是bug,目前还没想到较好的解决方案。
>
>
>
> --
> Sent from: http://apache-flink.147419.n8.nabble.com/
>

Reply via email to