mirror of https://github.com/citusdata/citus.git
Add intermediate result tests with unsupported outer joins (#4262)
parent
0f209377c4
commit
790beea59f
|
@ -178,10 +178,20 @@ RIGHT JOIN reference_table c ON (true);
|
||||||
ERROR: cannot pushdown the subquery
|
ERROR: cannot pushdown the subquery
|
||||||
DETAIL: There exist a reference table in the outer part of the outer join
|
DETAIL: There exist a reference table in the outer part of the outer join
|
||||||
SELECT count(*) FROM distributed_table a
|
SELECT count(*) FROM distributed_table a
|
||||||
|
LEFT JOIN (SELECT * FROM reference_table OFFSET 0) b ON (true)
|
||||||
|
RIGHT JOIN (SELECT * FROM reference_table OFFSET 0) c ON (true);
|
||||||
|
ERROR: cannot pushdown the subquery
|
||||||
|
DETAIL: Complex subqueries and CTEs cannot be in the outer part of the outer join
|
||||||
|
SELECT count(*) FROM distributed_table a
|
||||||
LEFT JOIN reference_table b ON (true)
|
LEFT JOIN reference_table b ON (true)
|
||||||
RIGHT JOIN reference_table c ON (c.id > 0);
|
RIGHT JOIN reference_table c ON (c.id > 0);
|
||||||
ERROR: cannot pushdown the subquery
|
ERROR: cannot pushdown the subquery
|
||||||
DETAIL: There exist a reference table in the outer part of the outer join
|
DETAIL: There exist a reference table in the outer part of the outer join
|
||||||
|
SELECT count(*) FROM distributed_table a
|
||||||
|
LEFT JOIN (SELECT * FROM reference_table OFFSET 0) b ON (true)
|
||||||
|
RIGHT JOIN (SELECT * FROM reference_table OFFSET 0) c ON (c.id > 0);
|
||||||
|
ERROR: cannot pushdown the subquery
|
||||||
|
DETAIL: Complex subqueries and CTEs cannot be in the outer part of the outer join
|
||||||
-- drop existing sqlancer tables before next tests
|
-- drop existing sqlancer tables before next tests
|
||||||
DROP TABLE t0, t1, t2, t3, t4 CASCADE;
|
DROP TABLE t0, t1, t2, t3, t4 CASCADE;
|
||||||
CREATE TABLE IF NOT EXISTS t0(c0 TEXT CHECK (TRUE), c1 money ) WITH (autovacuum_vacuum_threshold=1180014707, autovacuum_freeze_table_age=13771154, autovacuum_vacuum_cost_delay=23, autovacuum_analyze_threshold=1935153914, autovacuum_freeze_min_age=721733768, autovacuum_enabled=0, autovacuum_vacuum_cost_limit=9983);
|
CREATE TABLE IF NOT EXISTS t0(c0 TEXT CHECK (TRUE), c1 money ) WITH (autovacuum_vacuum_threshold=1180014707, autovacuum_freeze_table_age=13771154, autovacuum_vacuum_cost_delay=23, autovacuum_analyze_threshold=1935153914, autovacuum_freeze_min_age=721733768, autovacuum_enabled=0, autovacuum_vacuum_cost_limit=9983);
|
||||||
|
@ -279,6 +289,21 @@ JOIN
|
||||||
ON (true);
|
ON (true);
|
||||||
ERROR: cannot pushdown the subquery
|
ERROR: cannot pushdown the subquery
|
||||||
DETAIL: There exist a reference table in the outer part of the outer join
|
DETAIL: There exist a reference table in the outer part of the outer join
|
||||||
|
SELECT
|
||||||
|
count(*)
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT a.* FROM distributed_table a JOIN distributed_table b USING (user_id)
|
||||||
|
) AS bar
|
||||||
|
JOIN
|
||||||
|
(
|
||||||
|
SELECT a.* FROM distributed_table a
|
||||||
|
LEFT JOIN (SELECT * FROM reference_table OFFSET 0) b ON (true)
|
||||||
|
RIGHT JOIN (SELECT * FROM reference_table OFFSET 0) c ON (true)
|
||||||
|
) AS unsupported_join
|
||||||
|
ON (true);
|
||||||
|
ERROR: cannot pushdown the subquery
|
||||||
|
DETAIL: Complex subqueries and CTEs cannot be in the outer part of the outer join
|
||||||
-- unsupported outer JOIN in a sublevel INNER JOIN
|
-- unsupported outer JOIN in a sublevel INNER JOIN
|
||||||
SELECT
|
SELECT
|
||||||
unsupported_join.*
|
unsupported_join.*
|
||||||
|
@ -301,6 +326,22 @@ LEFT JOIN
|
||||||
(reference_table d JOIN reference_table e ON(true)) ON (true);
|
(reference_table d JOIN reference_table e ON(true)) ON (true);
|
||||||
ERROR: cannot pushdown the subquery
|
ERROR: cannot pushdown the subquery
|
||||||
DETAIL: There exist a reference table in the outer part of the outer join
|
DETAIL: There exist a reference table in the outer part of the outer join
|
||||||
|
SELECT
|
||||||
|
unsupported_join.*
|
||||||
|
FROM
|
||||||
|
(distributed_table a
|
||||||
|
LEFT JOIN (SELECT * FROM reference_table OFFSET 0) b ON (true)
|
||||||
|
RIGHT JOIN (SELECT * FROM reference_table OFFSET 0) c ON (true)) as unsupported_join
|
||||||
|
LEFT JOIN
|
||||||
|
(
|
||||||
|
(SELECT * FROM reference_table OFFSET 0) d
|
||||||
|
JOIN
|
||||||
|
(SELECT * FROM reference_table OFFSET 0) e
|
||||||
|
ON(true)
|
||||||
|
)
|
||||||
|
ON (true);
|
||||||
|
ERROR: cannot pushdown the subquery
|
||||||
|
DETAIL: Complex subqueries and CTEs cannot be in the outer part of the outer join
|
||||||
-- unsupported outer JOIN in a sublevel RIGHT JOIN
|
-- unsupported outer JOIN in a sublevel RIGHT JOIN
|
||||||
SELECT
|
SELECT
|
||||||
unsupported_join.*
|
unsupported_join.*
|
||||||
|
@ -312,6 +353,22 @@ RIGHT JOIN
|
||||||
(reference_table d JOIN reference_table e ON(true)) ON (true);
|
(reference_table d JOIN reference_table e ON(true)) ON (true);
|
||||||
ERROR: cannot pushdown the subquery
|
ERROR: cannot pushdown the subquery
|
||||||
DETAIL: There exist a reference table in the outer part of the outer join
|
DETAIL: There exist a reference table in the outer part of the outer join
|
||||||
|
SELECT
|
||||||
|
unsupported_join.*
|
||||||
|
FROM
|
||||||
|
(distributed_table a
|
||||||
|
LEFT JOIN (SELECT * FROM reference_table OFFSET 0) b ON (true)
|
||||||
|
RIGHT JOIN (SELECT * FROM reference_table OFFSET 0) c ON (false)) as unsupported_join
|
||||||
|
RIGHT JOIN
|
||||||
|
(
|
||||||
|
(SELECT * FROM reference_table OFFSET 0) d
|
||||||
|
JOIN
|
||||||
|
(SELECT * FROM reference_table OFFSET 0) e
|
||||||
|
ON(true)
|
||||||
|
)
|
||||||
|
ON (true);
|
||||||
|
ERROR: cannot pushdown the subquery
|
||||||
|
DETAIL: Complex subqueries and CTEs cannot be in the outer part of the outer join
|
||||||
EXPLAIN SELECT
|
EXPLAIN SELECT
|
||||||
unsupported_join.*
|
unsupported_join.*
|
||||||
FROM
|
FROM
|
||||||
|
|
|
@ -76,10 +76,18 @@ SELECT count(*) FROM distributed_table a
|
||||||
LEFT JOIN reference_table b ON (true)
|
LEFT JOIN reference_table b ON (true)
|
||||||
RIGHT JOIN reference_table c ON (true);
|
RIGHT JOIN reference_table c ON (true);
|
||||||
|
|
||||||
|
SELECT count(*) FROM distributed_table a
|
||||||
|
LEFT JOIN (SELECT * FROM reference_table OFFSET 0) b ON (true)
|
||||||
|
RIGHT JOIN (SELECT * FROM reference_table OFFSET 0) c ON (true);
|
||||||
|
|
||||||
SELECT count(*) FROM distributed_table a
|
SELECT count(*) FROM distributed_table a
|
||||||
LEFT JOIN reference_table b ON (true)
|
LEFT JOIN reference_table b ON (true)
|
||||||
RIGHT JOIN reference_table c ON (c.id > 0);
|
RIGHT JOIN reference_table c ON (c.id > 0);
|
||||||
|
|
||||||
|
SELECT count(*) FROM distributed_table a
|
||||||
|
LEFT JOIN (SELECT * FROM reference_table OFFSET 0) b ON (true)
|
||||||
|
RIGHT JOIN (SELECT * FROM reference_table OFFSET 0) c ON (c.id > 0);
|
||||||
|
|
||||||
-- drop existing sqlancer tables before next tests
|
-- drop existing sqlancer tables before next tests
|
||||||
DROP TABLE t0, t1, t2, t3, t4 CASCADE;
|
DROP TABLE t0, t1, t2, t3, t4 CASCADE;
|
||||||
|
|
||||||
|
@ -150,6 +158,21 @@ JOIN
|
||||||
) AS unsupported_join
|
) AS unsupported_join
|
||||||
ON (true);
|
ON (true);
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
count(*)
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT a.* FROM distributed_table a JOIN distributed_table b USING (user_id)
|
||||||
|
) AS bar
|
||||||
|
JOIN
|
||||||
|
(
|
||||||
|
SELECT a.* FROM distributed_table a
|
||||||
|
LEFT JOIN (SELECT * FROM reference_table OFFSET 0) b ON (true)
|
||||||
|
RIGHT JOIN (SELECT * FROM reference_table OFFSET 0) c ON (true)
|
||||||
|
) AS unsupported_join
|
||||||
|
ON (true);
|
||||||
|
|
||||||
|
|
||||||
-- unsupported outer JOIN in a sublevel INNER JOIN
|
-- unsupported outer JOIN in a sublevel INNER JOIN
|
||||||
SELECT
|
SELECT
|
||||||
unsupported_join.*
|
unsupported_join.*
|
||||||
|
@ -170,6 +193,21 @@ FROM
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(reference_table d JOIN reference_table e ON(true)) ON (true);
|
(reference_table d JOIN reference_table e ON(true)) ON (true);
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
unsupported_join.*
|
||||||
|
FROM
|
||||||
|
(distributed_table a
|
||||||
|
LEFT JOIN (SELECT * FROM reference_table OFFSET 0) b ON (true)
|
||||||
|
RIGHT JOIN (SELECT * FROM reference_table OFFSET 0) c ON (true)) as unsupported_join
|
||||||
|
LEFT JOIN
|
||||||
|
(
|
||||||
|
(SELECT * FROM reference_table OFFSET 0) d
|
||||||
|
JOIN
|
||||||
|
(SELECT * FROM reference_table OFFSET 0) e
|
||||||
|
ON(true)
|
||||||
|
)
|
||||||
|
ON (true);
|
||||||
|
|
||||||
-- unsupported outer JOIN in a sublevel RIGHT JOIN
|
-- unsupported outer JOIN in a sublevel RIGHT JOIN
|
||||||
SELECT
|
SELECT
|
||||||
unsupported_join.*
|
unsupported_join.*
|
||||||
|
@ -180,6 +218,21 @@ FROM
|
||||||
RIGHT JOIN
|
RIGHT JOIN
|
||||||
(reference_table d JOIN reference_table e ON(true)) ON (true);
|
(reference_table d JOIN reference_table e ON(true)) ON (true);
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
unsupported_join.*
|
||||||
|
FROM
|
||||||
|
(distributed_table a
|
||||||
|
LEFT JOIN (SELECT * FROM reference_table OFFSET 0) b ON (true)
|
||||||
|
RIGHT JOIN (SELECT * FROM reference_table OFFSET 0) c ON (false)) as unsupported_join
|
||||||
|
RIGHT JOIN
|
||||||
|
(
|
||||||
|
(SELECT * FROM reference_table OFFSET 0) d
|
||||||
|
JOIN
|
||||||
|
(SELECT * FROM reference_table OFFSET 0) e
|
||||||
|
ON(true)
|
||||||
|
)
|
||||||
|
ON (true);
|
||||||
|
|
||||||
EXPLAIN SELECT
|
EXPLAIN SELECT
|
||||||
unsupported_join.*
|
unsupported_join.*
|
||||||
FROM
|
FROM
|
||||||
|
|
Loading…
Reference in New Issue