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>)'
?
設(shè)法改成:
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)
?
再次設(shè)法改成:
? ? ? ? StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
? ? ? ? StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
?
問題解決
?
?
?
總結(jié)
以上是生活随笔為你收集整理的Cannot resolve method addSource的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 腾讯会议app怎么用(腾讯视频VIP会员
- 下一篇: 绝地求生闭气键在哪