【已解决】doris从1.2.6升级到2.0.4后。fe的日志一直有Unknown table 'column_statistics'的报错

Viewed 176

doris从1.2.6升级到2.0.4后。fe的日志一直在刷新以下报错信息,但是这个报错不影响查询,该怎么解决呢,是直接新建这个表

2024-04-08 17:20:52,522 WARN (STATS_FETCH-8|704) [StmtExecutor.executeInternalQuery():2517] Fall back to legacy planner, because: Table [column_statistics] does not exist in database [default_cluster:__internal_schema].
org.apache.doris.nereids.exceptions.AnalysisException: Table [column_statistics] does not exist in database [default_cluster:__internal_schema].
        at org.apache.doris.nereids.util.RelationUtil.getDbAndTable(RelationUtil.java:102) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.util.RelationUtil.getTable(RelationUtil.java:81) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.rules.analysis.BindRelation.bind(BindRelation.java:178) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.rules.analysis.BindRelation.doBindRelation(BindRelation.java:117) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.rules.analysis.BindRelation.lambda$build$0(BindRelation.java:93) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.pattern.PatternMatcher$1.transform(PatternMatcher.java:92) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.jobs.rewrite.PlanTreeRewriteJob.rewrite(PlanTreeRewriteJob.java:49) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.jobs.rewrite.PlanTreeRewriteBottomUpJob.rewriteThis(PlanTreeRewriteBottomUpJob.java:116) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.jobs.rewrite.PlanTreeRewriteBottomUpJob.execute(PlanTreeRewriteBottomUpJob.java:80) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.jobs.scheduler.SimpleJobScheduler.executeJobPool(SimpleJobScheduler.java:39) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.jobs.rewrite.RootPlanTreeRewriteJob.execute(RootPlanTreeRewriteJob.java:52) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.jobs.executor.AbstractBatchJobExecutor.execute(AbstractBatchJobExecutor.java:119) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.jobs.executor.Analyzer.analyze(Analyzer.java:109) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.NereidsPlanner.analyze(NereidsPlanner.java:285) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.NereidsPlanner.plan(NereidsPlanner.java:199) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.nereids.NereidsPlanner.plan(NereidsPlanner.java:126) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.executeInternalQuery(StmtExecutor.java:2515) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.statistics.util.StatisticsUtil.execStatisticQuery(StatisticsUtil.java:142) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.statistics.StatisticsRepository.loadColStats(StatisticsRepository.java:369) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.statistics.ColumnStatisticsCacheLoader.loadFromStatsTable(ColumnStatisticsCacheLoader.java:64) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.statistics.ColumnStatisticsCacheLoader.doLoad(ColumnStatisticsCacheLoader.java:46) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.statistics.ColumnStatisticsCacheLoader.doLoad(ColumnStatisticsCacheLoader.java:33) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.statistics.StatisticsCacheLoader.lambda$asyncLoad$0(StatisticsCacheLoader.java:48) ~[doris-fe.jar:1.2-SNAPSHOT]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) ~[?:1.8.0_181]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_181]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_181]
        at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_181]
2024-04-08 17:20:52,523 WARN (STATS_FETCH-8|704) [StmtExecutor.executeInternalQuery():2529] Failed to run internal SQL: OriginStatement{originStmt='SELECT * FROM `default_cluster:__internal_schema`.`column_statistics` WHERE `id` = '33685105--1-after_visit_fyc'', idx=0}
org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unknown table 'column_statistics'
        at org.apache.doris.catalog.DatabaseIf.lambda$getTableOrAnalysisException$4(DatabaseIf.java:221) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.catalog.DatabaseIf.getTableOrException(DatabaseIf.java:138) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.catalog.DatabaseIf.getTableOrAnalysisException(DatabaseIf.java:220) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.analysis.SelectStmt.getTables(SelectStmt.java:402) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:973) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.executeInternalQuery(StmtExecutor.java:2522) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.statistics.util.StatisticsUtil.execStatisticQuery(StatisticsUtil.java:142) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.statistics.StatisticsRepository.loadColStats(StatisticsRepository.java:369) ~[doris-fe.jar:1.2-SNAPSHOT]

1 Answers

这是1.2和2.0中information_schema库里面的不一样的地方
可以在information_schema库里面创建这个表:

CREATE TABLE `column_statistics` (
  `SCHEMA_NAME` VARCHAR(64) NULL,
  `TABLE_NAME` VARCHAR(64) NULL,
  `COLUMN_NAME` VARCHAR(64) NULL,
  `HISTOGRAM` JSON NULL
) ENGINE=SCHEMA; 

可以的话,辛苦点一个采纳