This is an automated email from the ASF dual-hosted git repository.

hello-stephen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 23c42dbccf9 [fix](regression) wait row count for partition_key_minmax 
(#65124)
23c42dbccf9 is described below

commit 23c42dbccf9e147cc7fb69184c05e6f87e2082eb
Author: shuke <[email protected]>
AuthorDate: Thu Jul 2 09:51:37 2026 +0800

    [fix](regression) wait row count for partition_key_minmax (#65124)
    
    ## Proposed changes
    
    `partition_key_minmax` checks partition-pruned memo-plan statistics. In
    Cloud P0, this case can run the `EXPLAIN` before the physical index row
    count has finished reporting after insert/analyze. When that happens,
    the planner's selected-partition row count can be `0`, so the existing
    `ndv/count` assertions fail even though the partition-key `min/max` is
    already correct.
    
    This patch keeps the existing `EXPLAIN` assertions and adds a bounded
    wait for the base index strict row count via `show index stats <table>
    <index>` before running each memo-plan check.
    
    ## Testing
    
    - `git diff --check`
    
    No local regression environment was allocated in this session, so the
    targeted regression case was not run locally.
---
 .../suites/query_p0/stats/partition_key_minmax.groovy    | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/regression-test/suites/query_p0/stats/partition_key_minmax.groovy 
b/regression-test/suites/query_p0/stats/partition_key_minmax.groovy
index a7ca288ecf3..e20b0654a15 100644
--- a/regression-test/suites/query_p0/stats/partition_key_minmax.groovy
+++ b/regression-test/suites/query_p0/stats/partition_key_minmax.groovy
@@ -16,6 +16,19 @@
 // under the License.
 
 suite("partition_key_minmax") {
+    def waitIndexRowCountReported = { tableName, expectedRowCount ->
+        def lastResult = null
+        for (int i = 0; i < 60; i++) {
+            lastResult = sql """show index stats ${tableName} ${tableName};"""
+            logger.info("${tableName} index stats: " + lastResult)
+            if (lastResult[0][4].toString() == expectedRowCount.toString()) {
+                return
+            }
+            sleep(1000)
+        }
+        throw new Exception("${tableName} row count report timeout, last index 
stats: ${lastResult}")
+    }
+
     sql """
         drop table if exists rangetable;
         create table rangetable (a int,
@@ -32,6 +45,7 @@ suite("partition_key_minmax") {
 
         analyze table rangetable with sync;
     """
+    waitIndexRowCountReported("rangetable", 4)
     def columnStats = sql """show column cached stats rangetable"""
     logger.info("rangetable cached stats: " + columnStats)
     explain {
@@ -63,6 +77,7 @@ suite("partition_key_minmax") {
 
     analyze table listtable with sync;
     """
+    waitIndexRowCountReported("listtable", 3)
 
     columnStats = sql """show column cached stats listtable"""
     logger.info("listtable cached stats: " + columnStats)
@@ -74,4 +89,3 @@ suite("partition_key_minmax") {
         contains("id#0 -> ndv=1.0000, min=3.000000(3), max=3.000000(3), 
count=1.0000")
     }
 }
-


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to