Cannot resolve method addSource

原始代碼如下:

ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
BatchTableEnvironment tableEnv = BatchTableEnvironment.create(env);
DataStream<Row> source = env.addSource(new RichSourceFunction<Row>() ...

Intellij提示:

Cannot resolve method 'addSource(anonymous org.apache.flink.streaming.api.functions.source.RichSourceFunction<org.apache.flink.types.Row>)'

 

設法改成:

ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env);

 

Intellij提示:

in create(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment)

StreamTableEnvironment 

cannot be applied to

(org.apache.flink.api.java.ExecutionEnvironment)

 

再次設法改成:

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);

 

問題解決
 

 

 

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页