Rename table in storage_join test

This commit is contained in:
vdimir 2021-04-29 17:34:26 +03:00
parent 8197e1c0c1
commit 38c8853f2b
No known key found for this signature in database
GPG Key ID: F57B3E10A21DBB31
2 changed files with 21 additions and 21 deletions

View File

@ -1,17 +1,17 @@
DROP TABLE IF EXISTS join;
DROP TABLE IF EXISTS t2;
CREATE TABLE join (k UInt64, s String) ENGINE = Join(ANY, LEFT, k);
CREATE TABLE t2 (k UInt64, s String) ENGINE = Join(ANY, LEFT, k);
INSERT INTO join VALUES (1, 'abc'), (2, 'def');
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN join USING k;
INSERT INTO t2 VALUES (1, 'abc'), (2, 'def');
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k;
INSERT INTO join VALUES (6, 'ghi');
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN join USING k;
INSERT INTO t2 VALUES (6, 'ghi');
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k;
SELECT k, js1.s, join.s FROM (SELECT number AS k, number as s FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN join USING k;
SELECT k, js1.s, join.s FROM (SELECT toUInt64(number / 3) AS k, sum(number) as s FROM numbers(10) GROUP BY toUInt64(number / 3) WITH TOTALS) js1 ANY LEFT JOIN join USING k;
SELECT k, js1.s, t2.s FROM (SELECT number AS k, number as s FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k;
SELECT k, js1.s, t2.s FROM (SELECT toUInt64(number / 3) AS k, sum(number) as s FROM numbers(10) GROUP BY toUInt64(number / 3) WITH TOTALS) js1 ANY LEFT JOIN t2 USING k;
-- JOIN ON not supported for storage join
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN join ON js1.k == join.k; -- { serverError 48 }
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 ON js1.k == t2.k; -- { serverError 48 }
DROP TABLE join;
DROP TABLE t2;

View File

@ -1,18 +1,18 @@
DROP TABLE IF EXISTS join;
DROP TABLE IF EXISTS t2;
CREATE TABLE join (s String, x Array(UInt8), k UInt64) ENGINE = Join(ANY, LEFT, k);
CREATE TABLE t2 (s String, x Array(UInt8), k UInt64) ENGINE = Join(ANY, LEFT, k);
INSERT INTO join VALUES ('abc', [0], 1), ('def', [1, 2], 2);
INSERT INTO join (k, s) VALUES (3, 'ghi');
INSERT INTO join (x, k) VALUES ([3, 4, 5], 4);
INSERT INTO t2 VALUES ('abc', [0], 1), ('def', [1, 2], 2);
INSERT INTO t2 (k, s) VALUES (3, 'ghi');
INSERT INTO t2 (x, k) VALUES ([3, 4, 5], 4);
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN join USING k;
SELECT s, x FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN join USING k;
SELECT x, s, k FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN join USING k;
SELECT 1, x, 2, s, 3, k, 4 FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN join USING k;
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k;
SELECT s, x FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k;
SELECT x, s, k FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k;
SELECT 1, x, 2, s, 3, k, 4 FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k;
SELECT t1.k, t1.s, t2.x
FROM ( SELECT number AS k, 'a' AS s FROM numbers(2) GROUP BY number WITH TOTALS ) AS t1
ANY LEFT JOIN join AS t2 USING(k);
ANY LEFT JOIN t2 AS t2 USING(k);
DROP TABLE join;
DROP TABLE t2;