Skip to content

Commit 0324869

Browse files
committed
Split dynamic tests and rewrite them from sh to sql to speed up
1 parent bab5565 commit 0324869

File tree

52 files changed

+1539
-1377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1539
-1377
lines changed

tests/queries/0_stateless/03036_dynamic_read_subcolumns.reference

Lines changed: 0 additions & 57 deletions
This file was deleted.

tests/queries/0_stateless/03036_dynamic_read_subcolumns.sh

Lines changed: 0 additions & 62 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Array(Array(Dynamic))
2+
Array(Variant(String, UInt64))
3+
None
4+
String
5+
UInt64
6+
200000
7+
200000
8+
200000
9+
200000
10+
0
11+
0
12+
200000
13+
200000
14+
100000
15+
100000
16+
200000
17+
0
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-- Tags: long
2+
3+
set allow_experimental_variant_type = 1;
4+
set use_variant_as_common_type = 1;
5+
set allow_experimental_dynamic_type = 1;
6+
7+
drop table if exists test;
8+
create table test (id UInt64, d Dynamic) engine=MergeTree order by id settings min_rows_for_wide_part=1000000000, min_bytes_for_wide_part=10000000000;
9+
10+
insert into test select number, number from numbers(100000) settings min_insert_block_size_rows=50000;
11+
insert into test select number, 'str_' || toString(number) from numbers(100000, 100000) settings min_insert_block_size_rows=50000;
12+
insert into test select number, arrayMap(x -> multiIf(number % 9 == 0, NULL, number % 9 == 3, 'str_' || toString(number), number), range(number % 10 + 1)) from numbers(200000, 100000) settings min_insert_block_size_rows=50000;
13+
insert into test select number, NULL from numbers(300000, 100000) settings min_insert_block_size_rows=50000;
14+
insert into test select number, multiIf(number % 4 == 3, 'str_' || toString(number), number % 4 == 2, NULL, number % 4 == 1, number, arrayMap(x -> multiIf(number % 9 == 0, NULL, number % 9 == 3, 'str_' || toString(number), number), range(number % 10 + 1))) from numbers(400000, 400000) settings min_insert_block_size_rows=50000;
15+
insert into test select number, [range((number % 10 + 1)::UInt64)]::Array(Array(Dynamic)) from numbers(100000, 100000) settings min_insert_block_size_rows=50000;
16+
17+
select distinct dynamicType(d) as type from test order by type;
18+
select count() from test where dynamicType(d) == 'UInt64';
19+
select count() from test where d.UInt64 is not NULL;
20+
select count() from test where dynamicType(d) == 'String';
21+
select count() from test where d.String is not NULL;
22+
select count() from test where dynamicType(d) == 'Date';
23+
select count() from test where d.Date is not NULL;
24+
select count() from test where dynamicType(d) == 'Array(Variant(String, UInt64))';
25+
select count() from test where not empty(d.`Array(Variant(String, UInt64))`);
26+
select count() from test where dynamicType(d) == 'Array(Array(Dynamic))';
27+
select count() from test where not empty(d.`Array(Array(Dynamic))`);
28+
select count() from test where d is NULL;
29+
select count() from test where not empty(d.`Tuple(a Array(Dynamic))`.a.String);
30+
31+
select d, d.UInt64, d.String, d.`Array(Variant(String, UInt64))` from test format Null;
32+
select d.UInt64, d.String, d.`Array(Variant(String, UInt64))` from test format Null;
33+
select d.Int8, d.Date, d.`Array(String)` from test format Null;
34+
select d, d.UInt64, d.Date, d.`Array(Variant(String, UInt64))`, d.`Array(Variant(String, UInt64))`.size0, d.`Array(Variant(String, UInt64))`.UInt64 from test format Null;
35+
select d.UInt64, d.Date, d.`Array(Variant(String, UInt64))`, d.`Array(Variant(String, UInt64))`.size0, d.`Array(Variant(String, UInt64))`.UInt64, d.`Array(Variant(String, UInt64))`.String from test format Null;
36+
select d, d.`Tuple(a UInt64, b String)`.a, d.`Array(Dynamic)`.`Variant(String, UInt64)`.UInt64, d.`Array(Variant(String, UInt64))`.UInt64 from test format Null;
37+
select d.`Array(Dynamic)`.`Variant(String, UInt64)`.UInt64, d.`Array(Dynamic)`.size0, d.`Array(Variant(String, UInt64))`.UInt64 from test format Null;
38+
select d.`Array(Array(Dynamic))`.size1, d.`Array(Array(Dynamic))`.UInt64, d.`Array(Array(Dynamic))`.`Map(String, Tuple(a UInt64))`.values.a from test format Null;
39+
40+
drop table test;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Array(Array(Dynamic))
2+
Array(Variant(String, UInt64))
3+
None
4+
String
5+
UInt64
6+
200000
7+
200000
8+
200000
9+
200000
10+
0
11+
0
12+
200000
13+
200000
14+
100000
15+
100000
16+
200000
17+
0
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-- Tags: long
2+
3+
set allow_experimental_variant_type = 1;
4+
set use_variant_as_common_type = 1;
5+
set allow_experimental_dynamic_type = 1;
6+
7+
drop table if exists test;
8+
create table test (id UInt64, d Dynamic) engine=Memory;
9+
10+
insert into test select number, number from numbers(100000) settings min_insert_block_size_rows=50000;
11+
insert into test select number, 'str_' || toString(number) from numbers(100000, 100000) settings min_insert_block_size_rows=50000;
12+
insert into test select number, arrayMap(x -> multiIf(number % 9 == 0, NULL, number % 9 == 3, 'str_' || toString(number), number), range(number % 10 + 1)) from numbers(200000, 100000) settings min_insert_block_size_rows=50000;
13+
insert into test select number, NULL from numbers(300000, 100000) settings min_insert_block_size_rows=50000;
14+
insert into test select number, multiIf(number % 4 == 3, 'str_' || toString(number), number % 4 == 2, NULL, number % 4 == 1, number, arrayMap(x -> multiIf(number % 9 == 0, NULL, number % 9 == 3, 'str_' || toString(number), number), range(number % 10 + 1))) from numbers(400000, 400000) settings min_insert_block_size_rows=50000;
15+
insert into test select number, [range((number % 10 + 1)::UInt64)]::Array(Array(Dynamic)) from numbers(100000, 100000) settings min_insert_block_size_rows=50000;
16+
17+
select distinct dynamicType(d) as type from test order by type;
18+
select count() from test where dynamicType(d) == 'UInt64';
19+
select count() from test where d.UInt64 is not NULL;
20+
select count() from test where dynamicType(d) == 'String';
21+
select count() from test where d.String is not NULL;
22+
select count() from test where dynamicType(d) == 'Date';
23+
select count() from test where d.Date is not NULL;
24+
select count() from test where dynamicType(d) == 'Array(Variant(String, UInt64))';
25+
select count() from test where not empty(d.`Array(Variant(String, UInt64))`);
26+
select count() from test where dynamicType(d) == 'Array(Array(Dynamic))';
27+
select count() from test where not empty(d.`Array(Array(Dynamic))`);
28+
select count() from test where d is NULL;
29+
select count() from test where not empty(d.`Tuple(a Array(Dynamic))`.a.String);
30+
31+
select d, d.UInt64, d.String, d.`Array(Variant(String, UInt64))` from test format Null;
32+
select d.UInt64, d.String, d.`Array(Variant(String, UInt64))` from test format Null;
33+
select d.Int8, d.Date, d.`Array(String)` from test format Null;
34+
select d, d.UInt64, d.Date, d.`Array(Variant(String, UInt64))`, d.`Array(Variant(String, UInt64))`.size0, d.`Array(Variant(String, UInt64))`.UInt64 from test format Null;
35+
select d.UInt64, d.Date, d.`Array(Variant(String, UInt64))`, d.`Array(Variant(String, UInt64))`.size0, d.`Array(Variant(String, UInt64))`.UInt64, d.`Array(Variant(String, UInt64))`.String from test format Null;
36+
select d, d.`Tuple(a UInt64, b String)`.a, d.`Array(Dynamic)`.`Variant(String, UInt64)`.UInt64, d.`Array(Variant(String, UInt64))`.UInt64 from test format Null;
37+
select d.`Array(Dynamic)`.`Variant(String, UInt64)`.UInt64, d.`Array(Dynamic)`.size0, d.`Array(Variant(String, UInt64))`.UInt64 from test format Null;
38+
select d.`Array(Array(Dynamic))`.size1, d.`Array(Array(Dynamic))`.UInt64, d.`Array(Array(Dynamic))`.`Map(String, Tuple(a UInt64))`.values.a from test format Null;
39+
40+
drop table test;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Array(Array(Dynamic))
2+
Array(Variant(String, UInt64))
3+
None
4+
String
5+
UInt64
6+
200000
7+
200000
8+
200000
9+
200000
10+
0
11+
0
12+
200000
13+
200000
14+
100000
15+
100000
16+
200000
17+
0
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-- Tags: long
2+
3+
set allow_experimental_variant_type = 1;
4+
set use_variant_as_common_type = 1;
5+
set allow_experimental_dynamic_type = 1;
6+
7+
drop table if exists test;
8+
create table test (id UInt64, d Dynamic) engine=MergeTree order by id settings min_rows_for_wide_part=1, min_bytes_for_wide_part=1;
9+
10+
insert into test select number, number from numbers(100000) settings min_insert_block_size_rows=50000;
11+
insert into test select number, 'str_' || toString(number) from numbers(100000, 100000) settings min_insert_block_size_rows=50000;
12+
insert into test select number, arrayMap(x -> multiIf(number % 9 == 0, NULL, number % 9 == 3, 'str_' || toString(number), number), range(number % 10 + 1)) from numbers(200000, 100000) settings min_insert_block_size_rows=50000;
13+
insert into test select number, NULL from numbers(300000, 100000) settings min_insert_block_size_rows=50000;
14+
insert into test select number, multiIf(number % 4 == 3, 'str_' || toString(number), number % 4 == 2, NULL, number % 4 == 1, number, arrayMap(x -> multiIf(number % 9 == 0, NULL, number % 9 == 3, 'str_' || toString(number), number), range(number % 10 + 1))) from numbers(400000, 400000) settings min_insert_block_size_rows=50000;
15+
insert into test select number, [range((number % 10 + 1)::UInt64)]::Array(Array(Dynamic)) from numbers(100000, 100000) settings min_insert_block_size_rows=50000;
16+
17+
select distinct dynamicType(d) as type from test order by type;
18+
select count() from test where dynamicType(d) == 'UInt64';
19+
select count() from test where d.UInt64 is not NULL;
20+
select count() from test where dynamicType(d) == 'String';
21+
select count() from test where d.String is not NULL;
22+
select count() from test where dynamicType(d) == 'Date';
23+
select count() from test where d.Date is not NULL;
24+
select count() from test where dynamicType(d) == 'Array(Variant(String, UInt64))';
25+
select count() from test where not empty(d.`Array(Variant(String, UInt64))`);
26+
select count() from test where dynamicType(d) == 'Array(Array(Dynamic))';
27+
select count() from test where not empty(d.`Array(Array(Dynamic))`);
28+
select count() from test where d is NULL;
29+
select count() from test where not empty(d.`Tuple(a Array(Dynamic))`.a.String);
30+
31+
select d, d.UInt64, d.String, d.`Array(Variant(String, UInt64))` from test format Null;
32+
select d.UInt64, d.String, d.`Array(Variant(String, UInt64))` from test format Null;
33+
select d.Int8, d.Date, d.`Array(String)` from test format Null;
34+
select d, d.UInt64, d.Date, d.`Array(Variant(String, UInt64))`, d.`Array(Variant(String, UInt64))`.size0, d.`Array(Variant(String, UInt64))`.UInt64 from test format Null;
35+
select d.UInt64, d.Date, d.`Array(Variant(String, UInt64))`, d.`Array(Variant(String, UInt64))`.size0, d.`Array(Variant(String, UInt64))`.UInt64, d.`Array(Variant(String, UInt64))`.String from test format Null;
36+
select d, d.`Tuple(a UInt64, b String)`.a, d.`Array(Dynamic)`.`Variant(String, UInt64)`.UInt64, d.`Array(Variant(String, UInt64))`.UInt64 from test format Null;
37+
select d.`Array(Dynamic)`.`Variant(String, UInt64)`.UInt64, d.`Array(Dynamic)`.size0, d.`Array(Variant(String, UInt64))`.UInt64 from test format Null;
38+
select d.`Array(Array(Dynamic))`.size1, d.`Array(Array(Dynamic))`.UInt64, d.`Array(Array(Dynamic))`.`Map(String, Tuple(a UInt64))`.values.a from test format Null;
39+
40+
drop table test;

tests/queries/0_stateless/03037_dynamic_merges_1_horizontal.reference

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)