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

hellostephen pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 6a68b09100a branch-2.1: [fix](cache) fix mtmv cache can not use test 
#46537 (#46607)
6a68b09100a is described below

commit 6a68b09100a67498a3f3752fa06de87c081ead78
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jan 8 21:09:53 2025 +0800

    branch-2.1: [fix](cache) fix mtmv cache can not use test #46537 (#46607)
    
    Cherry-picked from #46537
    
    Co-authored-by: 924060929 <lanhuaj...@selectdb.com>
---
 .../src/main/java/org/apache/doris/common/NereidsSqlCacheManager.java | 2 +-
 regression-test/suites/mtmv_p0/test_mtmv_sql_cache_and_profile.groovy | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/NereidsSqlCacheManager.java 
b/fe/fe-core/src/main/java/org/apache/doris/common/NereidsSqlCacheManager.java
index ee1e9c17287..421cf575304 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/common/NereidsSqlCacheManager.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/common/NereidsSqlCacheManager.java
@@ -321,7 +321,7 @@ public class NereidsSqlCacheManager {
         // check table type and version
         for (Entry<FullTableName, TableVersion> scanTable : 
sqlCacheContext.getUsedTables().entrySet()) {
             TableVersion tableVersion = scanTable.getValue();
-            if (tableVersion.type != TableType.OLAP) {
+            if (tableVersion.type != TableType.OLAP && tableVersion.type != 
TableType.MATERIALIZED_VIEW) {
                 return true;
             }
             TableIf tableIf = findTableIf(env, scanTable.getKey());
diff --git 
a/regression-test/suites/mtmv_p0/test_mtmv_sql_cache_and_profile.groovy 
b/regression-test/suites/mtmv_p0/test_mtmv_sql_cache_and_profile.groovy
index 02191f0d4cd..846c42f138f 100644
--- a/regression-test/suites/mtmv_p0/test_mtmv_sql_cache_and_profile.groovy
+++ b/regression-test/suites/mtmv_p0/test_mtmv_sql_cache_and_profile.groovy
@@ -63,12 +63,13 @@ suite("test_mtmv_sql_cache_and_profile", "mtmv") {
     waitingMTMVTaskFinished(jobName)
 
     sql """set enable_sql_cache=true;"""
+    sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = 
'10')"
+    sleep(10 * 1000)
 
     long startTime = System.currentTimeMillis()
     long timeoutTimestamp = startTime + 5 * 60 * 1000
     def explain_res = ""
     while (System.currentTimeMillis() < timeoutTimestamp) {
-        sleep(5 * 1000)
         sql """select k2 from ${mvName} group by k2;"""
         try {
             explain_res = sql """explain plan select k2 from ${mvName} group 
by k2;"""
@@ -79,6 +80,7 @@ suite("test_mtmv_sql_cache_and_profile", "mtmv") {
         if (explain_res.toString().indexOf("LogicalSqlCache") != -1 || 
explain_res.toString().indexOf("PhysicalSqlCache") != -1) {
             break
         }
+        sleep(5 * 1000)
     }
     assertTrue(explain_res.toString().indexOf("LogicalSqlCache") != -1 || 
explain_res.toString().indexOf("PhysicalSqlCache") != -1)
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to