开发者社区 问答 正文

Flink报错:Invalid data type of time field for waterm

已解决

Flink报错:Invalid data type of time field for watermark definition. The field must be of type TIMESTAMP(p) or TIMESTAMP_LTZ(p), the supported precision 'p' is from 0 to 3, but the time field type is TIMESTAMP(6)

展开
收起
阿里云服务支持 2022-12-20 14:28:03 831 分享 版权
1 条回答
写回答
取消 提交回答
  • 官方回答

    【报错详情】

    Caused by: org.apache.flink.table.api.ValidationException: Invalid data type of time field for watermark definition. The field must be of type TIMESTAMP(p) or TIMESTAMP_LTZ(p), the supported precision 'p' is from 0 to 3, but the time field type is TIMESTAMP(6) at org.apache.flink.table.catalog.DefaultSchemaResolver.validateTimeColumn(DefaultSchemaResolver.java:263) at org.apache.flink.table.catalog.DefaultSchemaResolver.resolveWatermarkSpecs(DefaultSchemaResolver.java:218)

    【报错原因】

    watermark接收的字段,精度超过了TIMESTAMP(3)。

    【解决方案】

    将字段类型修改为TIMESTAMP(3)精度以内,或使用TO_TIMESTAMP函数将该字段类型进行转换。

    2022-12-20 14:33:10
    赞同 展开评论