Flink笔记(End):Flink异常解决

本文开头附:Flink 学习路线系列 ^ _ ^

1.Flink Table API 中,错误信息如下:

错误信息:

Exception in thread “main” org.apache.flink.table.api.TableException: Arity [2] of result [[Lorg.apache.flink.api.common.typeinfo.TypeInformation;@52354202] does not match the number[1] of requested type [GenericType<com.ddky.flink.tableAPI.WordCount>].

原因:
        因为 Table API 在 执行 tableEnv.toRetractStream(table, WordCount.class);操作时,无法读取到 WordCount 类中的属性。

解决方法:

  1. 类中属性为 private 修饰,没有写get() / set() 方法
  2. 将属性修饰符由 private 变为 public 修饰
发布了301 篇原创文章 · 获赞 66 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/lzb348110175/article/details/104516171