开发者社区 问答 正文

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 467 分享
分享
版权
举报
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 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答地址:
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等