2019-04-16 14:13:13 +00:00
|
|
|
drop table if exists aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2022-06-23 10:58:34 +00:00
|
|
|
set allow_deprecated_syntax_for_merge_tree=1;
|
2019-04-16 14:13:13 +00:00
|
|
|
create table aliases_test (date default today(), id default rand(), array default [0, 1, 2]) engine=MergeTree(date, id, 1);
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
insert into aliases_test (id) values (0);
|
|
|
|
select array from aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
alter table aliases_test modify column array alias [0, 1, 2];
|
|
|
|
select array from aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
alter table aliases_test modify column array default [0, 1, 2];
|
|
|
|
select array from aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2020-02-19 14:39:01 +00:00
|
|
|
alter table aliases_test add column struct.key Array(UInt8) default [0, 1, 2], add column struct.value Array(UInt8) default array;
|
2019-04-16 14:13:13 +00:00
|
|
|
select struct.key, struct.value from aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
alter table aliases_test modify column struct.value alias array;
|
|
|
|
select struct.key, struct.value from aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
select struct.key, struct.value from aliases_test array join struct;
|
|
|
|
select struct.key, struct.value from aliases_test array join struct as struct;
|
|
|
|
select class.key, class.value from aliases_test array join struct as class;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
drop table aliases_test;
|