mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Add test.
This commit is contained in:
parent
69ae6ace47
commit
5292c8b916
13
tests/queries/0_stateless/01232_untuple.reference
Normal file
13
tests/queries/0_stateless/01232_untuple.reference
Normal file
@ -0,0 +1,13 @@
|
||||
1 3
|
||||
hello 1 3 world
|
||||
9
|
||||
9 (0,1)
|
||||
key v1 v2 v3 v4 v5
|
||||
4 10 20 10 20 30
|
||||
3 70 20 10 20 30
|
||||
2 11 20 10 20 30
|
||||
5 10 20 10 20 30
|
||||
1 20 20 10 20 30
|
||||
6 10 20 10 20 30
|
||||
7 18 20 10 20 30
|
||||
8 30 20 10 20 30
|
10
tests/queries/0_stateless/01232_untuple.sql
Normal file
10
tests/queries/0_stateless/01232_untuple.sql
Normal file
@ -0,0 +1,10 @@
|
||||
select untuple((* except (b),)) from (select 1 a, 2 b, 3 c);
|
||||
select 'hello', untuple((* except (b),)), 'world' from (select 1 a, 2 b, 3 c);
|
||||
select argMax(untuple(x)) from (select (number, number + 1) as x from numbers(10));
|
||||
select argMax(untuple(x)), min(x) from (select (number, number + 1) as x from numbers(10)) having tuple(untuple(min(x))).1 != 42;
|
||||
|
||||
drop table if exists kv;
|
||||
create table kv (key int, v1 int, v2 int, v3 int, v4 int, v5 int) engine MergeTree order by key;
|
||||
insert into kv values (1, 10, 20, 10, 20, 30), (2, 11, 20, 10, 20, 30), (1, 18, 20, 10, 20, 30), (1, 20, 20, 10, 20, 30), (3, 70, 20, 10, 20, 30), (4, 10, 20, 10, 20, 30), (1, 10, 20, 10, 20, 30), (5, 10, 20, 10, 20, 30), (1, 10, 20, 10, 20, 30), (8, 30, 20, 10, 20, 30), (1, 10, 20, 10, 20, 30), (6, 10, 20, 10, 20, 30), (1, 10, 20, 10, 20, 30), (7, 18, 20, 10, 20, 30), (1, 10, 20, 10, 20, 30), (7, 10, 20, 10, 20, 30), (1, 10, 20, 10, 20, 30), (8, 10, 20, 10, 20, 30), (1, 10, 20, 10, 20, 30);
|
||||
select key, untuple(argMax((* except (key),), v1)) from kv group by key format TSVWithNames;
|
||||
drop table if exists kv;
|
Loading…
Reference in New Issue
Block a user