Exception in thread “main” org.apache.flink.table.api.ValidationException: Type TIMESTAMP(3) of table field ‘usertime’ does not match with the physical type TIMESTAMP(6) of the ‘usertime’ field of the TableSource return type.
这是由于flink与数据库的timestamp字段长度不匹配造成。flink的timestamp字段宽度时3,数据库字段宽度一般是6。解决方法很简单,将定义time字段时,指定timestamp的字段长度。
usertime timestamp(3)

这篇博客探讨了在使用Flink时遇到的类型匹配错误,具体表现为Flink表字段TIMESTAMP(3)与数据库TIMESTAMP(6)宽度不一致。解决方法是在定义Flink的时间字段时指定timestamp的正确字段长度。通过调整字段宽度,可以确保数据类型的一致性,从而避免数据转换异常。
1万+

被折叠的 条评论
为什么被折叠?



