2017-12-30 03:49:02 +00:00
|
|
|
drop table if exists test.aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2017-12-30 03:49:02 +00:00
|
|
|
create table test.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
|
|
|
|
2017-12-30 03:49:02 +00:00
|
|
|
insert into test.aliases_test (id) values (0);
|
|
|
|
select array from test.aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2017-12-30 03:49:02 +00:00
|
|
|
alter table test.aliases_test modify column array alias [0, 1, 2];
|
|
|
|
select array from test.aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2017-12-30 03:49:02 +00:00
|
|
|
alter table test.aliases_test modify column array default [0, 1, 2];
|
|
|
|
select array from test.aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2017-12-30 03:49:02 +00:00
|
|
|
alter table test.aliases_test add column struct.key default [0, 1, 2], add column struct.value default array;
|
|
|
|
select struct.key, struct.value from test.aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2017-12-30 03:49:02 +00:00
|
|
|
alter table test.aliases_test modify column struct.value alias array;
|
|
|
|
select struct.key, struct.value from test.aliases_test;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2017-12-30 03:49:02 +00:00
|
|
|
select struct.key, struct.value from test.aliases_test array join struct;
|
|
|
|
select struct.key, struct.value from test.aliases_test array join struct as struct;
|
|
|
|
select class.key, class.value from test.aliases_test array join struct as class;
|
2015-10-29 15:14:19 +00:00
|
|
|
|
2017-12-30 03:49:02 +00:00
|
|
|
drop table test.aliases_test;
|