-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Murphy <[email protected]>
- Loading branch information
1 parent
f5e89ff
commit c9272df
Showing
2 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
-- name: test_analyze_columnn | ||
create database analyze_test_${uuid0}; | ||
-- result: | ||
-- !result | ||
use analyze_test_${uuid0}; | ||
-- result: | ||
-- !result | ||
CREATE TABLE `t1` ( | ||
`k1` date, | ||
`k2` datetime, | ||
`k3` char(20), | ||
`k4` varchar(20), | ||
`k5` boolean, | ||
`k6` tinyint, | ||
`k7` smallint, | ||
`k8` int, | ||
`k9` bigint, | ||
`k10` largeint, | ||
`k11` float, | ||
`k12` double, | ||
`k13` decimal(27,9) ) | ||
DUPLICATE KEY(`k1`, `k2`, `k3`, `k4`, `k5`) | ||
DISTRIBUTED BY HASH(`k1`, `k2`, `k3`) BUCKETS 3 | ||
PROPERTIES ('replication_num' = '1'); | ||
-- result: | ||
-- !result | ||
admin set frontend config('enable_statistic_collect_on_first_load'='false'); | ||
-- result: | ||
-- !result | ||
INSERT INTO t1 VALUES | ||
('2020-10-22','2020-10-23 12:12:12','k3','k4',0,1,2,3,4,5,1.1,1.12,2.889), | ||
('2020-10-23','2020-10-24 12:12:12','k3','k4',0,0,2,3,4,5,1.1,1.12,2.889), | ||
('2020-10-24','2020-10-25 12:12:12','k3','k4',0,1,2,3,4,5,1.1,1.12,2.889), | ||
(null,'2020-10-26 12:12:12',null,null,null,null,null,null,null,null,1,1.12,2.889), | ||
(null,'2020-10-27 12:12:12','k3','k4',0,1,2,3,4,5,1.1,1.12,2.889); | ||
-- result: | ||
-- !result | ||
[UC] analyze sample table t1; | ||
-- result: | ||
analyze_test_8a14e06f2aaa4d4aa329877dfd869c7b.t1 sample status OK | ||
-- !result | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
-- result: | ||
[REGEX]analyze_test_.* t1 ALL SAMPLE .* {} 100% | ||
-- !result | ||
[UC] analyze full table t1\(k1,k2\); | ||
-- result: | ||
analyze_test_8a14e06f2aaa4d4aa329877dfd869c7b.t1 analyze status OK | ||
-- !result | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
-- result: | ||
[REGEX]analyze_test_.* t1 ALL SAMPLE .* {} 100% \(k1,FULL\),\(k2,FULL\) | ||
-- !result | ||
[UC] analyze full table t1\(k3,k4\); | ||
-- result: | ||
analyze_test_8a14e06f2aaa4d4aa329877dfd869c7b.t1 analyze status OK | ||
-- !result | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
-- result: | ||
[REGEX]analyze_test_.* t1 ALL SAMPLE .* {} 100% \(k1,FULL\),\(k2,FULL\),\(k3,FULL\),\(k4,FULL\) | ||
-- !result | ||
[UC] analyze sample table t1\(k3,k4\); | ||
-- result: | ||
analyze_test_8a14e06f2aaa4d4aa329877dfd869c7b.t1 sample status OK | ||
-- !result | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
-- result: | ||
[REGEX]analyze_test_.* t1 ALL SAMPLE .* {} 100% \(k1,FULL\),\(k2,FULL\),\(k3,SAMPLE\),\(k4,SAMPLE\) | ||
-- !result | ||
[UC] analyze sample table t1; | ||
-- result: | ||
analyze_test_8a14e06f2aaa4d4aa329877dfd869c7b.t1 sample status OK | ||
-- !result | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
-- result: | ||
[REGEX]analyze_test_.* t1 ALL SAMPLE .* {} 100% \(k1,FULL\),\(k2,FULL\),\(k3,SAMPLE\),\(k4,SAMPLE\) | ||
-- !result | ||
[UC] analyze full table t1; | ||
-- result: | ||
analyze_test_8a14e06f2aaa4d4aa329877dfd869c7b.t1 analyze status OK | ||
-- !result | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
-- result: | ||
[REGEX]analyze_test_.* t1 ALL FULL .* {} 100% \(k1,FULL\),\(k2,FULL\),\(k3,SAMPLE\),\(k4,SAMPLE\) | ||
-- !result | ||
[UC] drop stats t1; | ||
-- result: | ||
-- !result | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
-- result: | ||
-- !result | ||
[UC] analyze sample table t1; | ||
-- result: | ||
analyze_test_8a14e06f2aaa4d4aa329877dfd869c7b.t1 sample status OK | ||
-- !result | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
-- result: | ||
[REGEX]analyze_test_.* t1 ALL SAMPLE .* {} 100% | ||
-- !result | ||
admin set frontend config('enable_statistic_collect_on_first_load'='true'); | ||
-- result: | ||
-- !result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
-- name: test_analyze_columnn | ||
create database analyze_test_${uuid0}; | ||
use analyze_test_${uuid0}; | ||
|
||
CREATE TABLE `t1` ( | ||
`k1` date, | ||
`k2` datetime, | ||
`k3` char(20), | ||
`k4` varchar(20), | ||
`k5` boolean, | ||
`k6` tinyint, | ||
`k7` smallint, | ||
`k8` int, | ||
`k9` bigint, | ||
`k10` largeint, | ||
`k11` float, | ||
`k12` double, | ||
`k13` decimal(27,9) ) | ||
DUPLICATE KEY(`k1`, `k2`, `k3`, `k4`, `k5`) | ||
DISTRIBUTED BY HASH(`k1`, `k2`, `k3`) BUCKETS 3 | ||
PROPERTIES ('replication_num' = '1'); | ||
|
||
admin set frontend config('enable_statistic_collect_on_first_load'='false'); | ||
|
||
INSERT INTO t1 VALUES | ||
('2020-10-22','2020-10-23 12:12:12','k3','k4',0,1,2,3,4,5,1.1,1.12,2.889), | ||
('2020-10-23','2020-10-24 12:12:12','k3','k4',0,0,2,3,4,5,1.1,1.12,2.889), | ||
('2020-10-24','2020-10-25 12:12:12','k3','k4',0,1,2,3,4,5,1.1,1.12,2.889), | ||
(null,'2020-10-26 12:12:12',null,null,null,null,null,null,null,null,1,1.12,2.889), | ||
(null,'2020-10-27 12:12:12','k3','k4',0,1,2,3,4,5,1.1,1.12,2.889); | ||
|
||
[UC] analyze sample table t1; | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
|
||
[UC] analyze full table t1(k1,k2); | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
|
||
[UC] analyze full table t1(k3,k4); | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
|
||
[UC] analyze sample table t1(k3,k4); | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
|
||
[UC] analyze sample table t1; | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
|
||
[UC] analyze full table t1; | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
|
||
[UC] drop stats t1; | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
|
||
[UC] analyze sample table t1; | ||
show stats meta where `database` = 'analyze_test_${uuid0}'; | ||
|
||
admin set frontend config('enable_statistic_collect_on_first_load'='true'); |