2024-08-13 09:53:33 +00:00
|
|
|
-- Tags: long
|
|
|
|
|
2024-07-24 13:06:29 +00:00
|
|
|
set allow_experimental_dynamic_type = 1;
|
|
|
|
set max_block_size = 1000;
|
|
|
|
|
|
|
|
drop table if exists test;
|
|
|
|
|
|
|
|
create table test (d Dynamic) engine=MergeTree order by tuple();
|
2024-08-13 13:20:37 +00:00
|
|
|
insert into test select multiIf(number < 1000, NULL::Dynamic(max_types=1), number < 3000, range(number % 5)::Dynamic(max_types=1), number::Dynamic(max_types=1)) from numbers(100000);
|
2024-08-12 21:29:26 +00:00
|
|
|
select '1';
|
|
|
|
select distinct dynamicType(d) as type, isDynamicElementInSharedData(d) as flag from test order by type;
|
2024-07-24 13:06:29 +00:00
|
|
|
|
|
|
|
drop table test;
|
2024-08-12 21:29:26 +00:00
|
|
|
create table test (d Dynamic(max_types=1)) engine=MergeTree order by tuple();
|
2024-08-13 13:20:37 +00:00
|
|
|
insert into test select multiIf(number < 1000, NULL::Dynamic(max_types=1), number < 3000, range(number % 5)::Dynamic(max_types=1), number::Dynamic(max_types=1)) from numbers(100000);
|
2024-08-12 21:29:26 +00:00
|
|
|
select '2';
|
|
|
|
select distinct dynamicType(d) as type, isDynamicElementInSharedData(d) as flag from test order by type;
|
2024-07-24 13:06:29 +00:00
|
|
|
|
|
|
|
truncate table test;
|
2024-08-13 13:20:37 +00:00
|
|
|
insert into test select multiIf(number < 1000, 'Str'::Dynamic(max_types=1), number < 3000, range(number % 5)::Dynamic(max_types=1), number::Dynamic(max_types=1)) from numbers(100000);
|
2024-08-12 21:29:26 +00:00
|
|
|
select '3';
|
|
|
|
select distinct dynamicType(d) as type, isDynamicElementInSharedData(d) as flag from test order by type;
|
2024-07-24 13:06:29 +00:00
|
|
|
|
|
|
|
drop table test;
|
|
|
|
|