Skip to content

Commit ed2a4d6

Browse files
[UT] fix flaky test test_analyze_column & test_be_proc_profile_simple (backport #64706) (#64729)
Co-authored-by: Murphy <[email protected]>
1 parent b3696c5 commit ed2a4d6

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

test/sql/test_analyze_statistics/R/test_analyze_column

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,19 @@ INSERT INTO t1 VALUES
3838
(null,'2020-10-27 12:12:12','k3','k4',0,1,2,3,4,5,1.1,1.12,2.889);
3939
-- result:
4040
-- !result
41+
drop stats t1;
42+
-- result:
43+
-- !result
4144
analyze sample table t1;
4245
-- result:
4346
test_analyze_column.t1 sample status OK
4447
-- !result
4548
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
4649
-- result:
4750
-- !result
51+
drop stats t1;
52+
-- result:
53+
-- !result
4854
analyze full table t1(k1,k2);
4955
-- result:
5056
test_analyze_column.t1 analyze status OK
@@ -54,38 +60,40 @@ select column_name, row_count from _statistics_.column_statistics where table_na
5460
k1 5
5561
k2 5
5662
-- !result
63+
drop stats t1;
64+
-- result:
65+
-- !result
5766
analyze full table t1(k3,k4);
5867
-- result:
5968
test_analyze_column.t1 analyze status OK
6069
-- !result
6170
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
6271
-- result:
63-
k1 5
64-
k2 5
6572
k3 5
6673
k4 5
6774
-- !result
75+
drop stats t1;
76+
-- result:
77+
-- !result
6878
analyze sample table t1(k3,k4);
6979
-- result:
7080
test_analyze_column.t1 sample status OK
7181
-- !result
7282
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
7383
-- result:
74-
k1 5
75-
k2 5
76-
k3 5
77-
k4 5
84+
-- !result
85+
drop stats t1;
86+
-- result:
7887
-- !result
7988
analyze sample table t1;
8089
-- result:
8190
test_analyze_column.t1 sample status OK
8291
-- !result
8392
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
8493
-- result:
85-
k1 5
86-
k2 5
87-
k3 5
88-
k4 5
94+
-- !result
95+
drop stats t1;
96+
-- result:
8997
-- !result
9098
analyze full table t1;
9199
-- result:
@@ -113,6 +121,9 @@ drop stats t1;
113121
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
114122
-- result:
115123
-- !result
124+
drop stats t1;
125+
-- result:
126+
-- !result
116127
analyze sample table t1;
117128
-- result:
118129
test_analyze_column.t1 sample status OK

test/sql/test_analyze_statistics/T/test_analyze_column

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,34 @@ INSERT INTO t1 VALUES
3131
(null,'2020-10-26 12:12:12',null,null,null,null,null,null,null,null,1,1.12,2.889),
3232
(null,'2020-10-27 12:12:12','k3','k4',0,1,2,3,4,5,1.1,1.12,2.889);
3333

34+
drop stats t1;
3435
analyze sample table t1;
3536
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
3637

38+
drop stats t1;
3739
analyze full table t1(k1,k2);
3840
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
3941

42+
drop stats t1;
4043
analyze full table t1(k3,k4);
4144
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
4245

46+
drop stats t1;
4347
analyze sample table t1(k3,k4);
4448
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
4549

50+
drop stats t1;
4651
analyze sample table t1;
4752
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
4853

54+
drop stats t1;
4955
analyze full table t1;
5056
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
5157

5258
drop stats t1;
5359
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
5460

61+
drop stats t1;
5562
analyze sample table t1;
5663
select column_name, row_count from _statistics_.column_statistics where table_name = 'test_analyze_column.t1' order by column_name ;
5764

0 commit comments

Comments
 (0)