From b26a185eb236634db35bbc6b56016783f887ba12 Mon Sep 17 00:00:00 2001 From: yujun Date: Wed, 27 May 2026 20:54:58 +0800 Subject: [PATCH] [fix](regression) Wait row count before partition stats check The partition row count regression asserts selected partition stats from BE-reported row counts. In Cloud, this row count can be stale immediately after insert, so wait until SHOW DATA reports the expected table row count before analyze and explain. Key changes: - Wait for partitionRowCountTable row count to reach 6 before analyze. - Keep the original stats=4 assertion to preserve the case intent. Unit Test: - git diff --check --- .../nereids_p0/stats/partitionRowCount.groovy | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/regression-test/suites/nereids_p0/stats/partitionRowCount.groovy b/regression-test/suites/nereids_p0/stats/partitionRowCount.groovy index d490ee52d7790d..7fab6298d6743d 100644 --- a/regression-test/suites/nereids_p0/stats/partitionRowCount.groovy +++ b/regression-test/suites/nereids_p0/stats/partitionRowCount.groovy @@ -29,6 +29,18 @@ suite("partitionRowCount") { distributed by hash(a) properties("replication_num"="1"); insert into partitionRowCountTable values (5, 3, 0), (22, 150, 1), (333, 1, 2); insert into partitionRowCountTable values (5, 3, 10), (22, 150, 11), (333, 1, 12); + """ + def tableData = sql "show data from partitionRowCountTable;" + def retry = 0 + while (tableData[0][4] != "6" && retry < 120) { + sleep(1000) + tableData = sql "show data from partitionRowCountTable;" + retry++ + logger.info("wait partitionRowCountTable row count, retry " + retry + " times, tableData: " + tableData) + } + assertEquals("6", tableData[0][4], "partitionRowCountTable row count is not reported: " + tableData) + + sql """ analyze table partitionRowCountTable with sync; """ explain { @@ -38,4 +50,4 @@ suite("partitionRowCount") { contains("PhysicalOlapScan[partitionRowCountTable partitions(2/3)]@0 ( stats=4, operativeSlots=[a#0]") } -} \ No newline at end of file +}