ClickHouse/dbms/tests/queries/0_stateless/00483_reading_from_array_structure.sql
Nikolai Kochetov da9b515e22 added tests
2017-07-28 22:29:40 +03:00

13 lines
924 B
SQL

drop table if exists test.table;
create table test.table (date Date, `Struct.Key1` Array(UInt64), `Struct.Key2` Array(UInt64), padding FixedString(16)) engine = MergeTree(date, (date), 16);
insert into test.table select today() as date, [number], [number + 1], toFixedString('', 16) from system.numbers limit 100;
set preferred_max_column_in_block_size_bytes = 96;
select blockSize(), * from test.table prewhere `Struct.Key1`[1] = 19 and `Struct.Key2`[1] >= 0 format Null;
drop table if exists test.table;
create table test.table (date Date, `Struct.Key1` Array(UInt64), `Struct.Key2` Array(UInt64), padding FixedString(16), x UInt64) engine = MergeTree(date, (date), 8);
insert into test.table select today() as date, [number], [number + 1], toFixedString('', 16), number from system.numbers limit 100;
set preferred_max_column_in_block_size_bytes = 112;
select blockSize(), * from test.table prewhere x = 7 format Null;