flink代码出现no instance(s) of type variable(s) T0, T1, T2 exist

肇事代码是:

DataSet> in = env.readCsvFile("file://"+rootPath+"/"+"projection.csv").types(Integer.class, Double.class, String.class);

intellij提示如下:

Incompatible types. Required DataSet>

but 'types' was inferred to DataSource>:

no instance(s) of type variable(s) T0, T1, T2 exist

so that Tuple3 conforms to Tuple3

 

解决方案:

import scala.Tuple2;
import scala.Tuple3;
改成
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.api.java.tuple.Tuple2;

 

你可能感兴趣的:(Flink)