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

yujun777 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 12d74a25174 [fix](regression) Wait for sync MV row count (#68015)
12d74a25174 is described below

commit 12d74a2517458a70d8e2c54645b2df69248f7fdf
Author: yujun <[email protected]>
AuthorDate: Wed Sep 16 14:11:25 2026 +0800

    [fix](regression) Wait for sync MV row count (#68015)
    
    The regression test could run EXPLAIN before the synchronous
    materialized view index row count was reported to FE, causing unstable
    MV rewrite selection. This change polls `SHOW INDEX STATS <table> <mv>`
    and waits for `report_row_count_for_nereids` to reach the expected value
    before checking the rewrite plan.
---
 .../suites/rollup_p0/test_create_mv_and_mtmv.groovy         | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/regression-test/suites/rollup_p0/test_create_mv_and_mtmv.groovy 
b/regression-test/suites/rollup_p0/test_create_mv_and_mtmv.groovy
index b8c3639fb42..c947341e2cd 100644
--- a/regression-test/suites/rollup_p0/test_create_mv_and_mtmv.groovy
+++ b/regression-test/suites/rollup_p0/test_create_mv_and_mtmv.groovy
@@ -52,6 +52,19 @@ suite("test_create_mv_and_mtmv") {
                  dt;
 
     """)
+    def expectedRowCounts = [2]
+    def rowCounts = []
+    for (int i = 0; i < 120; i++) {
+        def result = sql """SHOW INDEX STATS ${tableName} ${mvName};"""
+        rowCounts = result.collect { it[4].toInteger() }
+        log.info("SHOW INDEX STATS ${tableName} ${mvName}: ${result}, MV row 
counts: ${rowCounts}")
+        if (rowCounts == expectedRowCounts) {
+            break
+        }
+        Thread.sleep(5000)
+    }
+    assertEquals(expectedRowCounts, rowCounts,
+            "Unexpected row counts for materialized view ${mvName}")
     explain {
         sql("""
                     SELECT dt,advertiser,


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

Reply via email to