Flink问题记录:A raw type backed by type information has no serializable string representation. It ....

Flink问题记录:A raw type backed by type information has no serializable string representation. It ....,第1张

Flink问题记录:A raw type backed by type information has no serializable string representation. It ....

问题原因:table转成stream,table中字段要和stream字段类型一致,如果不一致,就会报上述的错误。其实就是table是什么类型,转回流时还是必须这个类型。

示例:

StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
StreamTableEnvironment tableEnv = StreamTableEnvironment.getTableEnvironment(env);
DataStream> sourceStream = env.addSource(kafkaSource);
//注册表时时两个字段
Table table = tableEnv.registerDataStream("tableName", sourceStream);
//转成流时类型为tuple1,只有一个字段,不匹配,应转成tuple2
DataStream> sinkStream = tableEnv.toAppendStream(table, Tuple1.class);

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5669492.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存