Flink中常见的几种异常

问题一:
Exception in thread “main” org.apache.flink.table.api.TableException: Could not instantiate the executor. Make sure a planner module is on the classpath
at org.apache.flink.table.api.java.internal.StreamTableEnvironmentImpl.lookupExecutor(StreamTableEnvironmentImpl.java:147)
at org.apache.flink.table.api.java.internal.StreamTableEnvironmentImpl.create(StreamTableEnvironmentImpl.java:116)
at org.apache.flink.table.api.java.StreamTableEnvironment.create(StreamTableEnvironment.java:112)
at com.cn.flink.function.MyStreamingSource$StreamingDemo.main(MyStreamingSource.java:185)
Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a suitable table factory for ‘org.apache.flink.table.delegation.ExecutorFactory’ in

Exception in thread "main" org.apache.flink.table.api.TableException: Could not instantiate the executor. Make sure a planner module is on the classpath
	at org.apache.flink.table.api.java.internal.StreamTableEnvironmentImpl.lookupExecutor(StreamTableEnvironmentImpl.java:147)
	at org.apache.flink.table.api.java.internal.StreamTableEnvironmentImpl.create(StreamTableEnvironmentImpl.java:116)
	at org.apache.flink.table.api.java.StreamTableEnvironment.create(StreamTableEnvironment.java:112)
	at com.cn.flink.function.MyStreamingSource$StreamingDemo.main(MyStreamingSource.java:185)
Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a suitable table factory for 'org.apache.flink.table.delegation.ExecutorFactory' in

解决方案
缺少pom文件

        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
            <version>${flink.version}</version>
        </dependency>

在此运行解决

问题二
Field types of query result and registered TableSink do not match.
返回结果时使用对象时类型与返回结果不对应
解决方案
先查看表结构

Table queryTable = bsTableEnv.sqlQuery ("select a.id,a.name,b.id,b.name from evenTable as a join oddTable as b on a.name = b.name");
            queryTable.printSchema ();

在这里插入图片描述

在创建对应的样例类
在这里插入图片描述
返回即可
在这里插入图片描述
解决
问题三Too many fields referenced from an atomic type.
在这里插入图片描述
由于手敲前面忘了加public公共的
解决方案
在这里插入图片描述

已解决

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值