为了更快的定位您的问题,请提供以下信息,谢谢
【详述】问题详细描述
在spring boot中,用jdbctemplate两表联查,求行数报异常,sql如下:
select count() from
select a.a1,a.a2,b.b1,b.b2
from a left join b on a.exp1 = b.exp1) as t
在jdbctemplate下执行如下sql,就没有问题(在子查询里加了where条件):
select count() from
select a.a1,a.a2,b.b1,b.b2,a.exp1
from a left join b on a.exp1 = b.exp1 where a.exp1=‘3’) as t
报错提示内容是:
nested exception is java.sql.SQLSyntaxErrorException: only found column statistics: {343: exp1}, but missing statistic of col: 253: exp1.
报异常的内容如下:
at com.starrocks.sql.optimizer.statistics.Statistics.getColumnStatistic(Statistics.java:83) ~[starrocks-fe.jar:?]
at com.starrocks.sql.optimizer.statistics.StatisticsCalculator.lambda$computeJoinNode$3(StatisticsCalculator.java:788) ~[starrocks-fe.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602) ~[?:?]
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:280) ~[?:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602) ~[?:?]
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) ~[?:?]
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) ~[?:?]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:632) ~[?:?]
at com.starrocks.sql.optimizer.statistics.StatisticsCalculator.computeJoinNode(StatisticsCalculator.java:789) ~[starrocks-fe.jar:?]
at com.starrocks.sql.optimizer.statistics.StatisticsCalculator.visitLogicalJoin(StatisticsCalculator.java:746) ~[starrocks-fe.jar:?]
at com.starrocks.sql.optimizer.statistics.StatisticsCalculator.visitLogicalJoin(StatisticsCalculator.java:167) ~[starrocks-fe.jar:?]
at com.starrocks.sql.optimizer.operator.logical.LogicalJoinOperator.accept(LogicalJoinOperator.java:200) ~[starrocks-fe.jar:?]
at com.starrocks.sql.optimizer.statistics.Statistic
这两个表重新建,再执行相同sql,是没有问题的。
【背景】做过哪些操作?
数据库系统从3.2.2升级到了3.2.4,表是升级后建的。
数据库里有关于这两个表的异步物化视图(怀疑是异步物化视图导致的这个问题)
【业务影响】
统计查询报错
【是否存算分离】
否
【StarRocks版本】例如:3.2.4
【集群规模】例如:3fe(1 follower+2observer)+5be(fe与be混部)
1fe+ 3be
【机器信息】CPU虚拟核/内存/网卡,例如:48C/64G/万兆
虚拟机 Intel® Xeon® CPU E5-2620 v3 @ 2.40GHz/16G/
【联系方式】为了在解决问题过程中能及时联系到您获取一些日志信息,请补充下您的联系方式,例如:社区群4-小李或者邮箱,谢谢
社区群18-Mathematics
【附件】
- fe.log/beINFO/相应截图
- 慢查询:
- Profile信息
- 并行度:show variables like ‘%parallel_fragment_exec_instance_num%’;
- pipeline是否开启:show variables like ‘%pipeline%’;
- be节点cpu和内存使用率截图
- 查询报错:
- query_dump,怎么获取query_dump文件
- be crash
- be.out
- 外表查询报错
- be.out和fe.warn.log