Flink遇到的坑
Flink 算子 使用Java 8 Lambda
问题
Caused by: org.apache.flink.api.common.functions.InvalidTypesException: The generic type parameters of 'Collector' are missing.
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.解决
Exception in thread "main" org.apache.flink.api.common.functions.InvalidTypesException:
The return type of function 'main(MyFlinkDemo.java:26)' 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.扩充
总结
Last updated