【概述】表的partitions信息缺少LastConsistencyCheckTime

为了更快的定位您的问题,请提供以下信息,谢谢
【详述】某张表不加过滤条件可以查到数据,加了反而查不到。
【背景】
【业务影响】
【是否存算分离】
【StarRocks版本】例如:3.1.5
【集群规模】例如:3fe + 11be(fe与be混部)
【机器信息】96C/256G/万兆
【联系方式】li.pc@topsports.com.cn
【附件】无报错信息。explain也可以看到当加上“损坏”分区条件时,scan patition为空。

请发下这个表的建表语句

sr-issue.txt (4.7 KB)

不加过滤条件的SQL和加过滤条件的SQL,能脱敏发一下吗? 区别是partition过滤?

– 加过滤条件,查不出数据
select * from shop_kpi.dws_dim_task_dtl where p_mon = ‘202412’ limit 10;

– 不加条件,能看到12月的数据
select * from shop_kpi.dws_dim_task_dtl order by p_mon desc limit 10;


麻烦发下有查询结果和无结果的两个查询的执行计划

sr-issue-plan.txt (3.2 KB)
这是之前抓的。有问题的plan,分区的确是没有

虽然show partitions, show tablet时,lastConsistencyCheckTime为空。但是
SHOW PROC “/statistic”; 的结果中也看不到有不一致的tablet。
而且运行过admin check tablet之后,虽然有值了,但是仍然查询没有结果。

admin execute on frontend '
import com.starrocks.catalog.OlapTable;
import com.starrocks.catalog.ListPartitionInfo;
def table = (OlapTable) globalState.getMetadataMgr().getTable("default_catalog", "shop_kpi", "dws_dim_task_dtl");
def listInfo = (ListPartitionInfo) table.getPartitionInfo();
out.append("${listInfo.getPartitionIds(false)}")
';

admin execute on frontend '
import com.starrocks.catalog.OlapTable;
import com.starrocks.catalog.ListPartitionInfo;
def table = (OlapTable) globalState.getMetadataMgr().getTable("default_catalog", "shop_kpi", "dws_dim_task_dtl");
def listInfo = (ListPartitionInfo) table.getPartitionInfo();
out.append("${listInfo.getMultiLiteralExprValues().keySet()}")
';

admin execute on frontend '
import com.starrocks.catalog.OlapTable;
import com.starrocks.catalog.ListPartitionInfo;
def table = (OlapTable) globalState.getMetadataMgr().getTable("default_catalog", "shop_kpi", "dws_dim_task_dtl");
def listInfo = (ListPartitionInfo) table.getPartitionInfo();
out.append("${listInfo.getIdToValues().keySet()}")
';

麻烦分别执行一下这三个命令,看看返回的结果是啥

[91973349, 91973396, 91973441, 91973486, 91973531, 91973576, 91973621, 91973666, 91973711, 91973756, 91973801, 91973846, 91973891, 91974381, 91974446, 91974491, 91974536, 91974586, 91974631, 91974676, 91974721, 91974766, 91974811, 91974857, 91974902, 91974947, 91974992, 91975037, 91975082, 91975127, 92742285, 92814577, 92814624, 93197844, 93197934]

[91974586, 91975037, 91973756, 92742285, 91974902, 91973621, 91975082, 91973801, 91973486, 91974446, 91974766, 91974381, 91974947, 91973666, 93197844, 91974631, 91973349, 91973531, 91974491, 91974811, 93197934, 92814624, 91974992, 91975127, 91973846, 91973396, 91974676, 91974857, 91973576, 91974536, 91973711, 91973891, 92814577, 91973441, 91974721]

[91973124]

https://github.com/StarRocks/starrocks/pull/40579 应该是这个问题导致,可以升级到3.1最先版本再验证下。