flink具有类型提取系统,可以自动获取类型信息,获得序列化器或反序列化器。lambda表达式中使用泛型无法识别导致泛型擦除。
报错:In many cases lambda methods don't provide enough information for automatic type extraction when Java generics are involved. An easy workaround is to use an (anonymous) class instead that implements the 'org.apache.flink.api.common.functions.FlatMapFunction' interface. Otherwise the type has to be specified explicitly using type information
解决: