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].

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

解决方法:

  1. 类中属性为 private 修饰,没有写get() / set() 方法
  2. 将属性修饰符由 private 变为 public 修饰
  3. 类中字段类型改为基本类型(提供来自:ls Bryant )

你可能感兴趣的:(Flink)