mirror of https://github.com/citusdata/citus.git
Add tests for LEFT JOIN ON clauses preventing matches left/right.
parent
52bc209c37
commit
38f4722f6f
|
@ -120,6 +120,19 @@ FROM
|
|||
multi_outer_join_left a LEFT JOIN multi_outer_join_right b
|
||||
ON (l_custkey = r_custkey AND r_custkey = 5);
|
||||
|
||||
-- Apply a filter before the join (no matches right)
|
||||
SELECT
|
||||
count(l_custkey), count(r_custkey)
|
||||
FROM
|
||||
multi_outer_join_left a LEFT JOIN multi_outer_join_right b
|
||||
ON (l_custkey = r_custkey AND r_custkey = -1 /* nonexistant */);
|
||||
|
||||
-- Apply a filter before the join (no matches left)
|
||||
SELECT
|
||||
count(l_custkey), count(r_custkey)
|
||||
FROM
|
||||
multi_outer_join_left a LEFT JOIN multi_outer_join_right b
|
||||
ON (l_custkey = r_custkey AND l_custkey = -1 /* nonexistant */);
|
||||
|
||||
-- Right join should be disallowed in this case
|
||||
SELECT
|
||||
|
|
|
@ -158,6 +158,30 @@ LOG: join order: [ "multi_outer_join_left" ][ broadcast join "multi_outer_join_
|
|||
20 | 1
|
||||
(1 row)
|
||||
|
||||
-- Apply a filter before the join (no matches right)
|
||||
SELECT
|
||||
count(l_custkey), count(r_custkey)
|
||||
FROM
|
||||
multi_outer_join_left a LEFT JOIN multi_outer_join_right b
|
||||
ON (l_custkey = r_custkey AND r_custkey = -1 /* nonexistant */);
|
||||
LOG: join order: [ "multi_outer_join_left" ][ broadcast join "multi_outer_join_right" ]
|
||||
count | count
|
||||
-------+-------
|
||||
20 | 0
|
||||
(1 row)
|
||||
|
||||
-- Apply a filter before the join (no matches left)
|
||||
SELECT
|
||||
count(l_custkey), count(r_custkey)
|
||||
FROM
|
||||
multi_outer_join_left a LEFT JOIN multi_outer_join_right b
|
||||
ON (l_custkey = r_custkey AND l_custkey = -1 /* nonexistant */);
|
||||
LOG: join order: [ "multi_outer_join_left" ][ broadcast join "multi_outer_join_right" ]
|
||||
count | count
|
||||
-------+-------
|
||||
20 | 0
|
||||
(1 row)
|
||||
|
||||
-- Right join should be disallowed in this case
|
||||
SELECT
|
||||
min(r_custkey), max(r_custkey)
|
||||
|
|
Loading…
Reference in New Issue