运行flink任务时遇到的问题
The types of the interface org.apache.flink.api.common.functions.FlatMapFunction could not be inferred. Support for synthetic interfaces, lambdas, and generic or raw types is limited at this point
Exception in thread “main” org.apache.flink.api.common.functions.InvalidTypesException: The return type of function ‘main(WordCount.java:85)’ could not be determined automatically, due to type erasure. You can give type information hints by using the returns(…) method on the result of the transformation call, or by letting your function implement the ‘ResultTypeQueryable’ interface.
解决方法
flatmap()需要指定返回的类型
.flatMap(……)
.return(Types.STRING)