You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by ゞ野蠻遊戲χ <zh...@vip.qq.com> on 2020/12/19 04:14:53 UTC
Table api 中指定rowtime的问题
大家好!
当我把DataStream流转成Table,并且指定了rowtime,然后使用带有udtf的sql传入tableEnv.sql(),抛出如下错误:Rowtime attributes must not be in the input rows of a regular join. As a workaround you can cast the time attributes of input tables to TIMESTAMP before. 我也按照提示使用to_timestamp函数套在eventTime的外面,并没有起作用,请求如何解决?先是sql,eventTime是事件时间。
sql: select
tmp.metric_id as metric_id,
tmp.metric_config as metric_config,
startLat,
destName,
bizType,
orderId,
completedTime,
orderStatus,
startHexList,
cityId,
type,
destLat,
endHexList,
destLng,
createTime,
passengerId,
finishedTime,
vehicleId,
startLng,
startName,
eventTime
from
htw_order_dwd_htw_order_geo_Infos,
lateral table(
metricUdtf('aa')
) as tmp(metric_id, metric_config)
Thanks
Jiazhi
Re:Table api 中指定rowtime的问题
Posted by hailongwang <18...@163.com>.
Hi,
可以试下 CAST(eventTime AS TIMESTAMP)
Best,
Hailong
在 2020-12-19 11:14:53,"ゞ野蠻遊戲χ" <zh...@vip.qq.com> 写道:
>大家好!
> 当我把DataStream流转成Table,并且指定了rowtime,然后使用带有udtf的sql传入tableEnv.sql(),抛出如下错误:Rowtime attributes must not be in the input rows of a regular join. As a workaround you can cast the time attributes of input tables to TIMESTAMP before. 我也按照提示使用to_timestamp函数套在eventTime的外面,并没有起作用,请求如何解决?先是sql,eventTime是事件时间。
>
>
>sql: select
> tmp.metric_id as metric_id,
> tmp.metric_config as metric_config,
> startLat,
> destName,
> bizType,
> orderId,
> completedTime,
> orderStatus,
> startHexList,
> cityId,
> type,
> destLat,
> endHexList,
> destLng,
> createTime,
> passengerId,
> finishedTime,
> vehicleId,
> startLng,
> startName,
> eventTime
> from
> htw_order_dwd_htw_order_geo_Infos,
> lateral table(
> metricUdtf('aa')
> ) as tmp(metric_id, metric_config)
>
>
>Thanks
>Jiazhi