开发者社区> 问答> 正文

flink1.11.0 执行sqlQuery时报NullPointException

本人正在为公司之前基于flink1.10的gateway升级flink版本到1.11,用的hive catalog,建表后,执行sqlQuery方法时报NullPointException,希望给出排错建议,具体报错信息如下:

Caused by: java.lang.NullPointerException

at java.util.Objects.requireNonNull(Objects.java:203)

at org.apache.calcite.rel.metadata.RelMetadataQuery. (RelMetadataQuery.java:141)

at org.apache.calcite.rel.metadata.RelMetadataQuery. (RelMetadataQuery.java:106)

at org.apache.flink.table.planner.plan.metadata.FlinkRelMetadataQuery. (FlinkRelMetadataQuery.java:73)

at org.apache.flink.table.planner.plan.metadata.FlinkRelMetadataQuery.instance(FlinkRelMetadataQuery.java:52)

at org.apache.flink.table.planner.calcite.FlinkRelOptClusterFactory$$anon$1.get(FlinkRelOptClusterFactory.scala:39)

at org.apache.flink.table.planner.calcite.FlinkRelOptClusterFactory$$anon$1.get(FlinkRelOptClusterFactory.scala:38)

at org.apache.calcite.plan.RelOptCluster.getMetadataQuery(RelOptCluster.java:178)

at org.apache.calcite.rel.logical.LogicalProject.create(LogicalProject.java:118)

at org.apache.calcite.rel.logical.LogicalProject.create(LogicalProject.java:111)

at org.apache.calcite.rel.core.RelFactories$ProjectFactoryImpl.createProject(RelFactories.java:180)

at org.apache.calcite.tools.RelBuilder.project_(RelBuilder.java:1462)

at org.apache.calcite.tools.RelBuilder.project(RelBuilder.java:1256)

at org.apache.calcite.tools.RelBuilder.projectNamed(RelBuilder.java:1521)

at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectList(SqlToRelConverter.java:4125)

at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:685)

at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:642)

at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3345)

at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:568)

at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$rel(FlinkPlannerImpl.scala:164)

at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.rel(FlinkPlannerImpl.scala:151)

at org.apache.flink.table.planner.calcite.SqlExprToRexConverterImpl.convertToRexNodes(SqlExprToRexConverterImpl.java:81)

at org.apache.flink.table.planner.calcite.SqlExprToRexConverterImpl.convertToRexNode(SqlExprToRexConverterImpl.java:73)

at org.apache.flink.table.planner.delegation.ParserImpl.parseSqlExpression(ParserImpl.java:93)

at org.apache.flink.table.api.internal.CatalogTableSchemaResolver.resolveExpressionDataType(CatalogTableSchemaResolver.java:119)

at org.apache.flink.table.api.internal.CatalogTableSchemaResolver.resolve(CatalogTableSchemaResolver.java:83)

at org.apache.flink.table.catalog.CatalogManager.resolveTableSchema(CatalogManager.java:380)

at org.apache.flink.table.catalog.CatalogManager.getPermanentTable(CatalogManager.java:408)

at org.apache.flink.table.catalog.CatalogManager.getTable(CatalogManager.java:375)

at org.apache.flink.table.planner.catalog.DatabaseCalciteSchema.getTable(DatabaseCalciteSchema.java:75)

at org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83)

at org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:289)

at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:143)

at org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99)

at org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:203)

at org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:112)

at org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:184)

at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)

at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1110)

at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1084)

at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3256)

at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3238)

at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3510)

at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)

at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)

at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1110)

at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1084)

at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:232)

at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1059)

at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:766)

at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$validate(FlinkPlannerImpl.scala:141)

... 54 more*来自志愿者整理的flink邮件归档

展开
收起
说了是一只鲳鱼 2021-12-07 10:14:06 1050 0
1 条回答
写回答
取消 提交回答
  • 你们是否在多线程环境下使用 TableEnvironment ? TableEnvironment 不是线程安全的,多线程情况使用可能出现一些莫名其妙的问题。*来自志愿者整理的flink邮件归档

    2021-12-07 11:35:39
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Flink CDC Meetup PPT - 龚中强 立即下载
Flink CDC Meetup PPT - 王赫 立即下载
Flink CDC Meetup PPT - 覃立辉 立即下载