This is an automated email from the ASF dual-hosted git repository.
huajianlan pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new f52b44bd98a branch-3.0: [fix](cache) fix mtmv cache can not use test
#46537 (#46555)
f52b44bd98a is described below
commit f52b44bd98aee2499659816af2390d9c84a3e993
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jan 8 10:54:35 2025 +0800
branch-3.0: [fix](cache) fix mtmv cache can not use test #46537 (#46555)
fix mtmv can not use sql cache, introduced by #46443
---
.../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 5434a185cd0..d2aa68ffe9a 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
@@ -322,7 +322,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: [email protected]
For additional commands, e-mail: [email protected]