Support use of BY NAME quantifier across all set ops (#1309)

Co-authored-by: Alexander Beedie <alexander.beedie@adia.ae>
Co-authored-by: Joey Hain <joey@sigmacomputing.com>
This commit is contained in:
Alexander Beedie 2024-06-17 22:14:40 +04:00 committed by GitHub
parent deac269710
commit 0330f9def5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 18 additions and 21 deletions

View file

@ -6010,6 +6010,12 @@ fn parse_union_except_intersect() {
verified_stmt("SELECT foo FROM tab UNION SELECT bar FROM TAB");
verified_stmt("(SELECT * FROM new EXCEPT SELECT * FROM old) UNION ALL (SELECT * FROM old EXCEPT SELECT * FROM new) ORDER BY 1");
verified_stmt("(SELECT * FROM new EXCEPT DISTINCT SELECT * FROM old) UNION DISTINCT (SELECT * FROM old EXCEPT DISTINCT SELECT * FROM new) ORDER BY 1");
verified_stmt("SELECT 1 AS x, 2 AS y EXCEPT BY NAME SELECT 9 AS y, 8 AS x");
verified_stmt("SELECT 1 AS x, 2 AS y EXCEPT ALL BY NAME SELECT 9 AS y, 8 AS x");
verified_stmt("SELECT 1 AS x, 2 AS y EXCEPT DISTINCT BY NAME SELECT 9 AS y, 8 AS x");
verified_stmt("SELECT 1 AS x, 2 AS y INTERSECT BY NAME SELECT 9 AS y, 8 AS x");
verified_stmt("SELECT 1 AS x, 2 AS y INTERSECT ALL BY NAME SELECT 9 AS y, 8 AS x");
verified_stmt("SELECT 1 AS x, 2 AS y INTERSECT DISTINCT BY NAME SELECT 9 AS y, 8 AS x");
}
#[test]