This is an automated email from the ASF dual-hosted git repository.
zhangstar333 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 8c5af5a088a [fix](case) Fix test_analyze case (#25476)
8c5af5a088a is described below
commit 8c5af5a088aeb45762611e4406210516b34f017f
Author: AKIRA <[email protected]>
AuthorDate: Tue Oct 17 15:06:01 2023 +0800
[fix](case) Fix test_analyze case (#25476)
It has following problems before this PR
use count(*) to check if all column analyzed
return directly when fe count > 1
Co-authored-by: AKIHA <[email protected]>
---
.../suites/statistics/analyze_stats.groovy | 38 +++++++++++-----------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/regression-test/suites/statistics/analyze_stats.groovy
b/regression-test/suites/statistics/analyze_stats.groovy
index 7bf0bef89fd..5f6735c7fb2 100644
--- a/regression-test/suites/statistics/analyze_stats.groovy
+++ b/regression-test/suites/statistics/analyze_stats.groovy
@@ -18,7 +18,9 @@ import java.util.stream.Collectors
// under the License.
suite("test_analyze") {
- String db = "regression_test_statistics"
+
+ String db = "test_analyze"
+
String tbl = "analyzetestlimited_duplicate_all"
sql """
@@ -39,6 +41,7 @@ suite("test_analyze") {
DROP TABLE IF EXISTS `${tbl}`
"""
+
sql """
CREATE TABLE IF NOT EXISTS `${tbl}` (
`analyzetestlimitedk3` int(11) null comment "",
@@ -86,12 +89,6 @@ suite("test_analyze") {
'ps7qwcZjBjkGfcXYMw5HQMwnElzoHqinwk8vhQCbVoGBgfotc4oSkpD3tP34h4h0tTogDMwFu60iJm1bofUzyUQofTeRwZk8','4692206687866847780')
"""
- def frontends = sql """
- SHOW FRONTENDS;
- """
- if (frontends.size > 1) {
- return;
- }
sql """
ANALYZE DATABASE ${db}
"""
@@ -102,7 +99,7 @@ suite("test_analyze") {
sql """
SET enable_nereids_planner=true;
-
+
"""
sql """
SET enable_fallback_to_original_planner=false;
@@ -114,7 +111,7 @@ suite("test_analyze") {
Thread.sleep(1000 * 60)
sql """
- SELECT COUNT(*) FROM ${tbl};
+ SELECT * FROM ${tbl};
"""
sql """
@@ -125,7 +122,7 @@ suite("test_analyze") {
try {
sql """
- SELECT * FROM ${tbl};
+ SELECT * FROM ${tbl};
"""
} catch (Exception e) {
exception = e
@@ -140,7 +137,7 @@ suite("test_analyze") {
"""
sql """
- SELECT COUNT(*) FROM ${tbl};
+ SELECT * FROM ${tbl};
"""
sql """
@@ -149,7 +146,7 @@ suite("test_analyze") {
try {
sql """
- SELECT COUNT(*) FROM ${tbl};
+ SELECT * FROM ${tbl};
"""
} catch (Exception e) {
exception = e
@@ -240,8 +237,8 @@ suite("test_analyze") {
SHOW COLUMN CACHED STATS analyze_partitioned_tbl_test(col1)
"""
- def expected_result = { r ->
- for (int i = 0; i < r.size; i++) {
+ def expected_result = { r->
+ for(int i = 0; i < r.size; i++) {
if ((int) Double.parseDouble(r[i][1]) == 6) {
return true
} else {
@@ -867,7 +864,7 @@ PARTITION `p598` VALUES IN (598),
PARTITION `p599` VALUES IN (599)
)
- DISTRIBUTED BY HASH(`id`) BUCKETS 16
+ DISTRIBUTED BY HASH(`id`) BUCKETS 1
PROPERTIES
(
"replication_num" = "1"
@@ -876,7 +873,10 @@ PARTITION `p599` VALUES IN (599)
"""
sql """
- INSERT INTO test_600_partition_table_analyze VALUES
(0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),(26),(27),(28),(29),(30),(31),(32),(33),(34),(35),(36),(37),(38),(39),(40),(41),(42),(43),(44),(45),(46),(47),(48),(49),(50),(51),(52),(53),(54),(55),(56),(57),(58),(59),(60),(61),(62),(63),(64),(65),(66),(67),(68),(69),(70),(71),(72),(73),(74),(75),(76),(77),(78),(79),(80),(81),(82),(83),(84),(85),(86),(87),(8
[...]
+ INSERT INTO test_600_partition_table_analyze VALUES
(0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),(26),(27),(28),(29),(30),(31),(32),(33),(34),(35),(36),(37),(38),(39),(40),(41),(42),(43),(44),(45),(46),(47),(48),(49),(50),(51),(52),(53),(54),(55),(56),(57),(58),(59),(60),(61),(62),(63),(64),(65),(66),(67),(68),(69),(70),(71),(72),(73),(74),(75),(76),(77),(78),(79),(80),(81),(82),(83),(84),(85),(86),(87),(8
[...]
+ """
+ sql """
+ INSERT INTO test_600_partition_table_analyze VALUES
(301),(302),(303),(304),(305),(306),(307),(308),(309),(310),(311),(312),(313),(314),(315),(316),(317),(318),(319),(320),(321),(322),(323),(324),(325),(326),(327),(328),(329),(330),(331),(332),(333),(334),(335),(336),(337),(338),(339),(340),(341),(342),(343),(344),(345),(346),(347),(348),(349),(350),(351),(352),(353),(354),(355),(356),(357),(358),(359),(360),(361),(362),(363),(364),(365),(366),(367),(368),(369),(370),(371),(372),
[...]
"""
sql """ANALYZE TABLE test_600_partition_table_analyze WITH SYNC"""
@@ -886,7 +886,7 @@ PARTITION `p599` VALUES IN (599)
SHOW COLUMN CACHED STATS test_600_partition_table_analyze(id);
"""
- def expected_col_stats = { r, expected_value, idx ->
+ def expected_col_stats = { r, expected_value, idx ->
return (int) Double.parseDouble(r[0][idx]) == expected_value
}
@@ -1046,6 +1046,7 @@ PARTITION `p599` VALUES IN (599)
sql """
DROP TABLE IF EXISTS two_thousand_partition_table_test
"""
+
// check analyze table with thousand partition
sql """
CREATE TABLE two_thousand_partition_table_test (col1 int(11451) not
null)
@@ -1055,7 +1056,7 @@ PARTITION `p599` VALUES IN (599)
from (0) to (1000001) INTERVAL 500
)
DISTRIBUTED BY HASH(col1)
- BUCKETS 3
+ BUCKETS 1
PROPERTIES(
"replication_num"="1"
);
@@ -1109,5 +1110,4 @@ PARTITION `p599` VALUES IN (599)
sql """ANALYZE TABLE test_meta_management WITH SYNC"""
afterDropped = sql """SHOW TABLE STATS test_meta_management"""
assert check_column(afterDropped, "[col1, col2, col3]")
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]