ClickHouse/tests/queries/0_stateless/03037_dynamic_merges_small.sql.j2

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
3.3 KiB
Plaintext
Raw Normal View History

2024-07-29 13:55:26 +00:00
set allow_experimental_variant_type = 1;
set use_variant_as_common_type = 1;
set allow_experimental_dynamic_type = 1;
2024-08-20 19:51:48 +00:00
2024-07-29 13:55:26 +00:00
drop table if exists test;
{% for engine in ['MergeTree order by id settings min_rows_for_wide_part=1000000000, min_bytes_for_wide_part=10000000000',
'MergeTree order by id settings min_rows_for_wide_part=1000000000, min_bytes_for_wide_part=10000000000, vertical_merge_algorithm_min_rows_to_activate=1, vertical_merge_algorithm_min_columns_to_activate=1',
'MergeTree order by id settings min_rows_for_wide_part=1, min_bytes_for_wide_part=1',
'MergeTree order by id settings min_rows_for_wide_part=1, min_bytes_for_wide_part=1, vertical_merge_algorithm_min_rows_to_activate=1, vertical_merge_algorithm_min_columns_to_activate=1'] -%}
2024-08-09 21:17:49 +00:00
create table test (id UInt64, d Dynamic(max_types=2)) engine={{ engine }};
2024-07-29 13:55:26 +00:00
system stop merges test;
insert into test select number, number from numbers(10);
insert into test select number, 'str_' || toString(number) from numbers(8);
insert into test select number, range(number % 10 + 1) from numbers(7);
insert into test select number, toDate(number) from numbers(6);
insert into test select number, toDateTime(number) from numbers(5);
insert into test select number, NULL from numbers(10);
2024-08-09 21:17:49 +00:00
select count(), dynamicType(d), isDynamicElementInSharedData(d) from test group by dynamicType(d), isDynamicElementInSharedData(d) order by count(), dynamicType(d);
2024-07-29 13:55:26 +00:00
system start merges test; optimize table test final;;
2024-08-09 21:17:49 +00:00
select '---------------------';
select count(), dynamicType(d), isDynamicElementInSharedData(d) from test group by dynamicType(d), isDynamicElementInSharedData(d) order by count(), dynamicType(d);
2024-07-29 13:55:26 +00:00
system stop merges test;
insert into test select number, map(number, number) from numbers(20);
2024-08-09 21:17:49 +00:00
select '---------------------';
select count(), dynamicType(d), isDynamicElementInSharedData(d) from test group by dynamicType(d), isDynamicElementInSharedData(d) order by count(), dynamicType(d);
2024-07-29 13:55:26 +00:00
system start merges test;
optimize table test final;
2024-08-09 21:17:49 +00:00
select '---------------------';
select count(), dynamicType(d), isDynamicElementInSharedData(d) from test group by dynamicType(d), isDynamicElementInSharedData(d) order by count(), dynamicType(d);
2024-07-29 13:55:26 +00:00
system stop merges test;
insert into test select number, tuple(number, number) from numbers(1);
2024-08-09 21:17:49 +00:00
select '---------------------';
select count(), dynamicType(d), isDynamicElementInSharedData(d) from test group by dynamicType(d), isDynamicElementInSharedData(d) order by count(), dynamicType(d);
2024-07-29 13:55:26 +00:00
system start merges test;
optimize table test final;
2024-08-09 21:17:49 +00:00
select '---------------------';
select count(), dynamicType(d), isDynamicElementInSharedData(d) from test group by dynamicType(d), isDynamicElementInSharedData(d) order by count(), dynamicType(d);
system stop merges test;
insert into test select number, 'str_' || number from numbers(3);
select '---------------------';
select count(), dynamicType(d), isDynamicElementInSharedData(d) from test group by dynamicType(d), isDynamicElementInSharedData(d) order by count(), dynamicType(d);
system start merges test;
optimize table test final;
select '---------------------';
select count(), dynamicType(d), isDynamicElementInSharedData(d) from test group by dynamicType(d), isDynamicElementInSharedData(d) order by count(), dynamicType(d);
2024-07-29 13:55:26 +00:00
drop table test;
{% endfor -%}