You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/06/27 11:17:29 UTC
[doris] branch master updated: [enhancement](nereids) Add log for stats (#21164)
This is an automated email from the ASF dual-hosted git repository.
morrysnow 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 acba8648a5 [enhancement](nereids) Add log for stats (#21164)
acba8648a5 is described below
commit acba8648a52bbae95eff03452634b3a3b1884c47
Author: AKIRA <33...@users.noreply.github.com>
AuthorDate: Tue Jun 27 20:17:22 2023 +0900
[enhancement](nereids) Add log for stats (#21164)
1. LOG sql when analyze failed
2. Return directly for analyze_test suite when there is more than one frontend
3. Set query_timeout for tpcds suites to avoid unneccessary failed caused by analyze sync
---
.../main/java/org/apache/doris/statistics/OlapAnalysisTask.java | 4 ++--
regression-test/suites/statistics/analyze_stats.groovy | 8 ++++++++
regression-test/suites/tpcds_sf100_dup_without_key_p2/load.groovy | 1 +
regression-test/suites/tpcds_sf100_p2/load.groovy | 1 +
regression-test/suites/tpcds_sf1_unique_p1/load.groovy | 1 +
regression-test/suites/tpch_sf100_p2/load.groovy | 1 +
.../suites/tpch_sf100_unique_p2/load_four_step/load.groovy | 1 +
.../suites/tpch_sf100_unique_p2/load_one_step/load.groovy | 1 +
.../suites/tpch_sf100_unique_p2/load_three_step/load.groovy | 1 +
.../suites/tpch_sf100_unique_p2/load_two_step/load.groovy | 1 +
regression-test/suites/tpch_sf100_unique_sql_p2/load.groovy | 1 +
11 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/OlapAnalysisTask.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/OlapAnalysisTask.java
index 47df548e84..1de121d9ef 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/statistics/OlapAnalysisTask.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/OlapAnalysisTask.java
@@ -119,8 +119,8 @@ public class OlapAnalysisTask extends BaseAnalysisTask {
stmtExecutor.execute();
QueryState queryState = r.connectContext.getState();
if (queryState.getStateType().equals(MysqlStateType.ERR)) {
- throw new RuntimeException(String.format("Failed to analyze %s.%s.%s, error: %s",
- info.catalogName, info.dbName, info.colName, queryState.getErrorMessage()));
+ throw new RuntimeException(String.format("Failed to analyze %s.%s.%s, error: %s sql: %s",
+ info.catalogName, info.dbName, info.colName, sql, queryState.getErrorMessage()));
}
}
}
diff --git a/regression-test/suites/statistics/analyze_stats.groovy b/regression-test/suites/statistics/analyze_stats.groovy
index 89de47fe89..b486385acc 100644
--- a/regression-test/suites/statistics/analyze_stats.groovy
+++ b/regression-test/suites/statistics/analyze_stats.groovy
@@ -66,6 +66,12 @@ suite("test_analyze") {
'ps7qwcZjBjkGfcXYMw5HQMwnElzoHqinwk8vhQCbVoGBgfotc4oSkpD3tP34h4h0tTogDMwFu60iJm1bofUzyUQofTeRwZk8','4692206687866847780')
"""
+ def frontends = sql """
+ SHOW FRONTENDS;
+ """
+ if (frontends.size > 1) {
+ return;
+ }
sql """
ANALYZE DATABASE ${db}
"""
@@ -85,6 +91,8 @@ suite("test_analyze") {
SET forbid_unknown_col_stats=true;
"""
+ Thread.sleep(1000 * 60)
+
sql """
SELECT COUNT(*) FROM ${tbl};
"""
diff --git a/regression-test/suites/tpcds_sf100_dup_without_key_p2/load.groovy b/regression-test/suites/tpcds_sf100_dup_without_key_p2/load.groovy
index e28da95065..bc74169b54 100644
--- a/regression-test/suites/tpcds_sf100_dup_without_key_p2/load.groovy
+++ b/regression-test/suites/tpcds_sf100_dup_without_key_p2/load.groovy
@@ -73,6 +73,7 @@ suite('load') {
rowCount = sql "select count(*) from ${table}"
}
assertEquals(rows, rowCount[0][0])
+ sql """SET query_timeout = 1800"""
sql """ ANALYZE TABLE $table WITH SYNC """
}
}
diff --git a/regression-test/suites/tpcds_sf100_p2/load.groovy b/regression-test/suites/tpcds_sf100_p2/load.groovy
index e28da95065..bc74169b54 100644
--- a/regression-test/suites/tpcds_sf100_p2/load.groovy
+++ b/regression-test/suites/tpcds_sf100_p2/load.groovy
@@ -73,6 +73,7 @@ suite('load') {
rowCount = sql "select count(*) from ${table}"
}
assertEquals(rows, rowCount[0][0])
+ sql """SET query_timeout = 1800"""
sql """ ANALYZE TABLE $table WITH SYNC """
}
}
diff --git a/regression-test/suites/tpcds_sf1_unique_p1/load.groovy b/regression-test/suites/tpcds_sf1_unique_p1/load.groovy
index b157211a48..bfe7b9fd31 100644
--- a/regression-test/suites/tpcds_sf1_unique_p1/load.groovy
+++ b/regression-test/suites/tpcds_sf1_unique_p1/load.groovy
@@ -137,6 +137,7 @@ suite("load") {
assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0)
}
}
+ sql """SET query_timeout=1800"""
sql """ ANALYZE TABLE $tableName WITH SYNC """
}
diff --git a/regression-test/suites/tpch_sf100_p2/load.groovy b/regression-test/suites/tpch_sf100_p2/load.groovy
index 40a03fbee8..7deae8e27d 100644
--- a/regression-test/suites/tpch_sf100_p2/load.groovy
+++ b/regression-test/suites/tpch_sf100_p2/load.groovy
@@ -67,6 +67,7 @@ suite("load") {
sleep(5000)
}
}
+ sql """SET query_timeout = 1800"""
sql """ ANALYZE TABLE $table WITH SYNC """
}
}
diff --git a/regression-test/suites/tpch_sf100_unique_p2/load_four_step/load.groovy b/regression-test/suites/tpch_sf100_unique_p2/load_four_step/load.groovy
index 5363bc67ec..81b7ceb249 100644
--- a/regression-test/suites/tpch_sf100_unique_p2/load_four_step/load.groovy
+++ b/regression-test/suites/tpch_sf100_unique_p2/load_four_step/load.groovy
@@ -116,6 +116,7 @@ suite("load_four_step") {
}
sleep(5000)
}
+ sql """SET query_timeout = 1800"""
sql """ ANALYZE TABLE $table WITH SYNC """
}
}
diff --git a/regression-test/suites/tpch_sf100_unique_p2/load_one_step/load.groovy b/regression-test/suites/tpch_sf100_unique_p2/load_one_step/load.groovy
index 9f5e065927..0304037124 100644
--- a/regression-test/suites/tpch_sf100_unique_p2/load_one_step/load.groovy
+++ b/regression-test/suites/tpch_sf100_unique_p2/load_one_step/load.groovy
@@ -68,6 +68,7 @@ suite("load_one_step") {
sleep(5000)
}
+ sql """SET query_timeout = 1800"""
sql """ ANALYZE TABLE $table WITH SYNC """
}
}
diff --git a/regression-test/suites/tpch_sf100_unique_p2/load_three_step/load.groovy b/regression-test/suites/tpch_sf100_unique_p2/load_three_step/load.groovy
index 287beaafea..6c296524a8 100644
--- a/regression-test/suites/tpch_sf100_unique_p2/load_three_step/load.groovy
+++ b/regression-test/suites/tpch_sf100_unique_p2/load_three_step/load.groovy
@@ -92,6 +92,7 @@ suite("load_three_step") {
}
sleep(5000)
}
+ sql """SET query_timeout = 1800"""
sql """ ANALYZE TABLE $table WITH SYNC """
}
}
diff --git a/regression-test/suites/tpch_sf100_unique_p2/load_two_step/load.groovy b/regression-test/suites/tpch_sf100_unique_p2/load_two_step/load.groovy
index 916c62a4d0..694793ff47 100644
--- a/regression-test/suites/tpch_sf100_unique_p2/load_two_step/load.groovy
+++ b/regression-test/suites/tpch_sf100_unique_p2/load_two_step/load.groovy
@@ -69,6 +69,7 @@ suite("load_two_step") {
}
sleep(5000)
}
+ sql """SET query_timeout = 1800"""
sql """ ANALYZE TABLE $table WITH SYNC """
}
}
diff --git a/regression-test/suites/tpch_sf100_unique_sql_p2/load.groovy b/regression-test/suites/tpch_sf100_unique_sql_p2/load.groovy
index 40a03fbee8..7deae8e27d 100644
--- a/regression-test/suites/tpch_sf100_unique_sql_p2/load.groovy
+++ b/regression-test/suites/tpch_sf100_unique_sql_p2/load.groovy
@@ -67,6 +67,7 @@ suite("load") {
sleep(5000)
}
}
+ sql """SET query_timeout = 1800"""
sql """ ANALYZE TABLE $table WITH SYNC """
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org