开发者社区> 问答> 正文

long转换后生long转换后生成watermark是什么成watermark是什么情况,好奇怪啊?

link-1.10 sql只支持 timestamp(3) 类型字段生成watermark 但是long这样转换后也可以生成watermark很奇怪? CREATE TABLE user_log ( response_size int, rowtime BIGINT, w_ts as TO_TIMESTAMP(FROM_UNIXTIME(rowtime/1000),'yyyy-MM-dd HH:mm:ss'), WATERMARK FOR w_ts AS w_ts - INTERVAL '5' SECOND --5秒的延迟 )

来自志愿者整理的flink邮件归档来自志愿者整理的FLINK邮件归档

展开
收起
雪哥哥 2021-12-04 17:08:17 436 0
1 条回答
写回答
取消 提交回答
  • w_ts as TO_TIMESTAMP(FROM_UNIXTIME(rowtime/1000),'yyyy-MM-dd HH:mm:ss'),这个语句产生的就是一个timestamp的数据Flink内置函数:https://ci.apache.org/projects/flink/flink-docs-release-1.10/zh/dev/table/functions/systemFunctions.htmlFROM_UNIXTIME(numeric[, string]): Returns a representation of the numeric argument as a value in string format (default is 'YYYY-MM-DD hh:mm:ss'). numeric is an internal timestamp value representing seconds since '1970-01-01 00:00:00' UTC, such as produced by the UNIX_TIMESTAMP() function. The return value is expressed in the session time zone (specified in TableConfig). E.g., FROM_UNIXTIME(44) returns '1970-01-01 09:00:44' if in UTC time zone, but returns '1970-01-01 09:00:44' if in 'Asia/Tokyo' time zone. Only supported in blink planner. TO_TIMESTAMP(string1[, string2]): Converts date time string string1 with format string2 (by default: 'yyyy-MM-dd HH:mm:ss') under the session time zone (specified by TableConfig) to a timestamp. Only supported in blink planner.

    来自志愿者整理的flink邮件归档来自志愿者整理的FLINK邮件归档

    2021-12-04 17:17:46
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Window_Time_Watermark 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载