Fixed tests

This commit is contained in:
Maksim Kita 2022-02-06 13:31:59 +00:00
parent 4cd7324b9b
commit 45fa68b4a8
12 changed files with 22 additions and 31 deletions

View File

@ -1,5 +1,5 @@
2000-01-01 1 [2,1] [4,3] [20,22] [2,2,1] ['5','5','0'] [-3,-3,-33] [10,100,1000]
2000-01-01 1 [1,2] [3,4] [10,11] [0,1,2] ['3','4','5'] [-1,-2,-3] [1,10,100] 2000-01-01 1 [1,2] [3,4] [10,11] [0,1,2] ['3','4','5'] [-1,-2,-3] [1,10,100]
2000-01-01 1 [2,1] [4,3] [20,22] [2,2,1] ['5','5','0'] [-3,-3,-33] [10,100,1000]
2000-01-01 2 [1,2] [3,4] [10,11] [0,1,2] ['3','4','5'] [-1,-2,-3] [1,10,100] 2000-01-01 2 [1,2] [3,4] [10,11] [0,1,2] ['3','4','5'] [-1,-2,-3] [1,10,100]
2000-01-01 2 [1,2] [3,4] [10,11] [0,1,2] ['3','4','5'] [-1,-2,-3] [1,10,100] 2000-01-01 2 [1,2] [3,4] [10,11] [0,1,2] ['3','4','5'] [-1,-2,-3] [1,10,100]
2000-01-01 2 [2,1,1] [4,3,3] [20,22,33] [2,2] ['5','5'] [-3,-3] [10,100] 2000-01-01 2 [2,1,1] [4,3,3] [20,22,33] [2,2] ['5','5'] [-3,-3] [10,100]

View File

@ -5,7 +5,7 @@ CREATE TABLE summing_composite_key (d Date, k UInt64, FirstMap Nested(k1 UInt32,
INSERT INTO summing_composite_key VALUES ('2000-01-01', 1, [1,2], ['3','4'], [10,11], [0,1,2], [3,4,5], [-1,-2,-3], [1,10,100]), ('2000-01-01', 1, [2,1], ['4','3'], [20,22], [2,2,1], [5,5,0], [-3,-3,-33], [10,100,1000]), ('2000-01-01', 2, [1,2], ['3','4'], [10,11], [0,1,2], [3,4,5], [-1,-2,-3], [1,10,100]), ('2000-01-01', 2, [2,1,1], ['4','3','3'], [20,22,33], [2,2], [5,5], [-3,-3], [10,100]), ('2000-01-01', 2, [1,2], ['3','4'], [10,11], [0,1,2], [3,4,5], [-1,-2,-3], [1,10,100]); INSERT INTO summing_composite_key VALUES ('2000-01-01', 1, [1,2], ['3','4'], [10,11], [0,1,2], [3,4,5], [-1,-2,-3], [1,10,100]), ('2000-01-01', 1, [2,1], ['4','3'], [20,22], [2,2,1], [5,5,0], [-3,-3,-33], [10,100,1000]), ('2000-01-01', 2, [1,2], ['3','4'], [10,11], [0,1,2], [3,4,5], [-1,-2,-3], [1,10,100]), ('2000-01-01', 2, [2,1,1], ['4','3','3'], [20,22,33], [2,2], [5,5], [-3,-3], [10,100]), ('2000-01-01', 2, [1,2], ['3','4'], [10,11], [0,1,2], [3,4,5], [-1,-2,-3], [1,10,100]);
SELECT * FROM summing_composite_key ORDER BY d, k, _part_index; SELECT * FROM summing_composite_key ORDER BY d, k, FirstMap.k1, FirstMap.k2ID, FirstMap.s, SecondMap.k1ID, SecondMap.k2Key, SecondMap.k3Type, SecondMap.s;
SELECT d, k, m.k1, m.k2ID, m.s FROM summing_composite_key ARRAY JOIN FirstMap AS m ORDER BY d, k, m.k1, m.k2ID, m.s, SecondMap.k1ID, SecondMap.k2Key, SecondMap.k3Type, SecondMap.s; SELECT d, k, m.k1, m.k2ID, m.s FROM summing_composite_key ARRAY JOIN FirstMap AS m ORDER BY d, k, m.k1, m.k2ID, m.s, SecondMap.k1ID, SecondMap.k2Key, SecondMap.k3Type, SecondMap.s;
SELECT d, k, m.k1, m.k2ID, sum(m.s) FROM summing_composite_key ARRAY JOIN FirstMap AS m GROUP BY d, k, m.k1, m.k2ID ORDER BY d, k, m.k1, m.k2ID; SELECT d, k, m.k1, m.k2ID, sum(m.s) FROM summing_composite_key ARRAY JOIN FirstMap AS m GROUP BY d, k, m.k1, m.k2ID ORDER BY d, k, m.k1, m.k2ID;
@ -17,7 +17,7 @@ SELECT d, k, m.k1ID, m.k2Key, m.k3Type, m.s FROM summing_composite_key FINAL ARR
OPTIMIZE TABLE summing_composite_key PARTITION 200001 FINAL; OPTIMIZE TABLE summing_composite_key PARTITION 200001 FINAL;
SELECT * FROM summing_composite_key ORDER BY d, k, _part_index; SELECT * FROM summing_composite_key ORDER BY d, k, FirstMap.k1, FirstMap.k2ID, FirstMap.s, SecondMap.k1ID, SecondMap.k2Key, SecondMap.k3Type, SecondMap.s;;
SELECT d, k, m.k1, m.k2ID, m.s FROM summing_composite_key ARRAY JOIN FirstMap AS m ORDER BY d, k, m.k1, m.k2ID, m.s; SELECT d, k, m.k1, m.k2ID, m.s FROM summing_composite_key ARRAY JOIN FirstMap AS m ORDER BY d, k, m.k1, m.k2ID, m.s;
SELECT d, k, m.k1, m.k2ID, sum(m.s) FROM summing_composite_key ARRAY JOIN FirstMap AS m GROUP BY d, k, m.k1, m.k2ID ORDER BY d, k, m.k1, m.k2ID; SELECT d, k, m.k1, m.k2ID, sum(m.s) FROM summing_composite_key ARRAY JOIN FirstMap AS m GROUP BY d, k, m.k1, m.k2ID ORDER BY d, k, m.k1, m.k2ID;

View File

@ -1,9 +1,9 @@
0.3 2018-11-19 13:00:00 \N 0.3 2018-11-19 13:00:00 \N
0.3 2018-11-19 13:05:00 \N 0.3 2018-11-19 13:05:00 \N
0.4 2018-11-19 13:10:00 1 0.4 2018-11-19 13:10:00 1
0.5 2018-11-19 13:15:00 1.5 0.5 2018-11-19 13:15:00 1.2
0.5 2018-11-19 13:30:00 2.2 0.6 2018-11-19 13:20:00 1.5
0.6 2018-11-19 13:15:00 1.3 0.7 2018-11-19 13:25:00 1.8
0.7 2018-11-19 13:20:00 1.8 0.8 2018-11-19 13:30:00 2.1
0.8 2018-11-19 13:25:00 2.4 0.9 2018-11-19 13:45:00 2.4
0.9 2018-11-19 13:25:00 2.1 0.5 2018-11-19 13:50:00 2.2

View File

@ -4,7 +4,7 @@ DROP TABLE IF EXISTS bm;
CREATE TABLE bm (amount float, business_dttm DateTime) engine Log; CREATE TABLE bm (amount float, business_dttm DateTime) engine Log;
INSERT INTO bm VALUES (0.3,'2018-11-19 13:00:00'), (0.3,'2018-11-19 13:05:00'), (0.4,'2018-11-19 13:10:00'), (0.5,'2018-11-19 13:15:00'), (0.6,'2018-11-19 13:15:00'), (0.7,'2018-11-19 13:20:00'), (0.8,'2018-11-19 13:25:00'), (0.9,'2018-11-19 13:25:00'), (0.5,'2018-11-19 13:30:00'); INSERT INTO bm VALUES (0.3,'2018-11-19 13:00:00'), (0.3,'2018-11-19 13:05:00'), (0.4,'2018-11-19 13:10:00'), (0.5,'2018-11-19 13:15:00'), (0.6,'2018-11-19 13:20:00'), (0.7,'2018-11-19 13:25:00'), (0.8,'2018-11-19 13:30:00'), (0.9,'2018-11-19 13:45:00'), (0.5,'2018-11-19 13:50:00');
WITH WITH
( (
@ -30,6 +30,6 @@ FROM
business_dttm business_dttm
FROM bm FROM bm
ORDER BY business_dttm ORDER BY business_dttm
) ORDER BY amount, business_dttm; ) ORDER BY business_dttm;
DROP TABLE bm; DROP TABLE bm;

View File

@ -7,10 +7,7 @@ any left
any left (rev) any left (rev)
0 5 b6 0 5 b6
2 a3 2 b1 2 a3 2 b1
2 a3 2 b2
4 a5 4 b3 4 a5 4 b3
4 a5 4 b4
4 a5 4 b5
any inner any inner
2 a3 2 b1 2 a3 2 b1
4 a5 4 b3 4 a5 4 b3
@ -20,10 +17,7 @@ any inner (rev)
any right any right
0 5 b6 0 5 b6
2 a3 2 b1 2 a3 2 b1
2 a3 2 b2
4 a5 4 b3 4 a5 4 b3
4 a5 4 b4
4 a5 4 b5
any right (rev) any right (rev)
0 a1 0 0 a1 0
1 a2 0 1 a2 0

View File

@ -5,7 +5,7 @@ CREATE TABLE t1 (x UInt32, s String) engine = Memory;
CREATE TABLE t2 (x UInt32, s String) engine = Memory; CREATE TABLE t2 (x UInt32, s String) engine = Memory;
INSERT INTO t1 (x, s) VALUES (0, 'a1'), (1, 'a2'), (2, 'a3'), (3, 'a4'), (4, 'a5'); INSERT INTO t1 (x, s) VALUES (0, 'a1'), (1, 'a2'), (2, 'a3'), (3, 'a4'), (4, 'a5');
INSERT INTO t2 (x, s) VALUES (2, 'b1'), (2, 'b2'), (4, 'b3'), (4, 'b4'), (4, 'b5'), (5, 'b6'); INSERT INTO t2 (x, s) VALUES (2, 'b1'), (4, 'b3'), (5, 'b6');
SET join_use_nulls = 0; SET join_use_nulls = 0;
SET any_join_distinct_right_table_keys = 0; SET any_join_distinct_right_table_keys = 0;

View File

@ -3,11 +3,10 @@ any left
1 a2 0 1 a2 0
2 a3 2 b1 2 a3 2 b1
3 a4 0 3 a4 0
4 a5 4 b3 4 a5 4 b2
any left (rev) any left (rev)
0 5 b4 0 5 b4
2 a3 2 b1 2 a3 2 b1
4 a5 4 b3
4 a5 4 b2 4 a5 4 b2
any inner any inner
2 a3 2 b1 2 a3 2 b1
@ -19,7 +18,6 @@ any right
0 5 b4 0 5 b4
2 a3 2 b1 2 a3 2 b1
4 a5 4 b2 4 a5 4 b2
4 a5 4 b3
any right (rev) any right (rev)
0 a1 0 0 a1 0
1 a2 0 1 a2 0
@ -28,11 +26,10 @@ any right (rev)
4 a5 4 b2 4 a5 4 b2
semi left semi left
2 a3 2 b1 2 a3 2 b1
4 a5 4 b3 4 a5 4 b2
semi right semi right
2 a3 2 b1 2 a3 2 b1
4 a5 4 b2 4 a5 4 b2
4 a5 4 b3
anti left anti left
0 a1 0 0 a1 0
1 a2 1 1 a2 1

View File

@ -5,7 +5,7 @@ CREATE TABLE t1 (x UInt32, s String) engine = Memory;
CREATE TABLE t2 (x UInt32, s String) engine = Memory; CREATE TABLE t2 (x UInt32, s String) engine = Memory;
INSERT INTO t1 (x, s) VALUES (0, 'a1'), (1, 'a2'), (2, 'a3'), (3, 'a4'), (4, 'a5'); INSERT INTO t1 (x, s) VALUES (0, 'a1'), (1, 'a2'), (2, 'a3'), (3, 'a4'), (4, 'a5');
INSERT INTO t2 (x, s) VALUES (2, 'b1'), (4, 'b2'), (4, 'b3'), (5, 'b4'); INSERT INTO t2 (x, s) VALUES (2, 'b1'), (4, 'b2'), (5, 'b4');
SET join_algorithm = 'prefer_partial_merge'; SET join_algorithm = 'prefer_partial_merge';
SET join_use_nulls = 0; SET join_use_nulls = 0;

View File

@ -8,11 +8,11 @@
1 1
1 1
1 1
4 0
3
1 1
2 2
0 3
4
0 0 0 0
0 1 0 1
0 2 0 2

View File

@ -5,7 +5,7 @@ create table wt (a Int, b Int) engine = Memory;
insert into wt select 0, number from numbers(5); insert into wt select 0, number from numbers(5);
select 1 from wt order by a limit 3 with ties; select 1 from wt order by a limit 3 with ties;
select b from wt order by a limit 3 with ties; select b from (select b from wt order by a limit 3 with ties) order by b;
select * from (select * from (with a * 2 as c select a, b from wt order by c limit 3 with ties) order by a, b); select * from (select * from (with a * 2 as c select a, b from wt order by c limit 3 with ties) order by a, b);
select * from (select * from (select a * 2 as c, b from wt order by c limit 3 with ties) order by c, b); select * from (select * from (select a * 2 as c, b from wt order by c limit 3 with ties) order by c, b);

View File

@ -9,7 +9,7 @@
1 1 1 1 1 1
2 2 2 2 2 2
┌─rowNr─┬─val_string─┬─str_m1───┬─str_p1───┬─val_low──┬─low_m1───┬─low_p1───┐ ┌─rowNr─┬─val_string─┬─str_m1───┬─str_p1───┬─val_low──┬─low_m1───┬─low_p1───┐
│ 1 │ String 1 │ String 1 │ String 2 │ String 1 │ String 1 │ String 2 │ 1 │ String 1 │ │ String 1 │ String 1 │ │ String 1
│ 2 │ String 1 │ │ String 1 │ String 1 │ │ String 1 │ 2 │ String 1 │ String 1 │ String 2 │ String 1 │ String 1 │ String 2
│ 3 │ String 2 │ String 1 │ │ String 2 │ String 1 │ │ │ 3 │ String 2 │ String 1 │ │ String 2 │ String 1 │ │
└───────┴────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘ └───────┴────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘

View File

@ -39,7 +39,7 @@ FROM
FROM neighbor_test FROM neighbor_test
ORDER BY val_string ASC ORDER BY val_string ASC
) )
ORDER By rowNr ORDER BY rowNr, val_string, str_m1, str_p1, val_low, low_m1, low_p1
format PrettyCompact; format PrettyCompact;
drop table if exists neighbor_test; drop table if exists neighbor_test;