-
Notifications
You must be signed in to change notification settings - Fork 783
ClickHouse: Support GLOBAL IN / GLOBAL NOT IN #2598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
s5dsn-eqee
wants to merge
4
commits into
apache:main
Choose a base branch
from
s5dsn-eqee:clickhouse-global-in
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+246
−9
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| SELECT * FROM t WHERE x GLOBAL IN (1, 2); | ||
| SELECT * FROM t WHERE x GLOBAL NOT IN (1, 2); | ||
| SELECT * FROM t WHERE x GLOBAL IN (SELECT y FROM t2); | ||
| SELECT * FROM t WHERE x GLOBAL NOT IN (SELECT y FROM t2); | ||
| SELECT * FROM t WHERE x GLOBAL IN t2; | ||
| SELECT * FROM t WHERE x GLOBAL IN (t2); | ||
| SELECT * FROM t WHERE x GLOBAL IN db.t2; | ||
| SELECT * FROM t WHERE x GLOBAL IN t2 AND y = 2; | ||
| SELECT * FROM t WHERE x global in (1) AND y Global Not In (2); | ||
| SELECT * FROM t WHERE x GLOBAL IN (1); | ||
| SELECT * FROM t WHERE x GLOBAL IN (NULL, 1, 'a', 1.5, -1, 1 + 2, y * 2); | ||
| SELECT * FROM t WHERE x GLOBAL IN ('', '''', 'GLOBAL IN'); | ||
| SELECT * FROM t WHERE x GLOBAL IN ((1), ((2)), (((3)))); | ||
| SELECT * FROM t WHERE x GLOBAL IN ((SELECT 1), 2); | ||
| SELECT * FROM t WHERE x GLOBAL IN ((SELECT 1)); | ||
| SELECT * FROM t WHERE x GLOBAL NOT IN (((SELECT 1)), (SELECT 2) + 1); | ||
| SELECT * FROM t WHERE x GLOBAL IN (SELECT 1 UNION ALL SELECT 2); | ||
| SELECT * FROM t WHERE x GLOBAL IN (SELECT y FROM t2 WHERE z GLOBAL IN (SELECT w FROM t3 WHERE v GLOBAL NOT IN (1))); | ||
| SELECT * FROM t WHERE (a, b) GLOBAL IN ((1, 2), (3, 4)); | ||
| SELECT * FROM t WHERE (a, b) GLOBAL NOT IN (SELECT a, b FROM t2); | ||
| SELECT * FROM t WHERE tuple(a, b) GLOBAL IN (SELECT a, b FROM t2); | ||
| SELECT * FROM t WHERE (SELECT 1) GLOBAL IN (1, 2); | ||
| SELECT * FROM t WHERE toInt32(x) GLOBAL IN (lower('a'), upper('b')); | ||
| SELECT * FROM t WHERE CAST(x AS String) GLOBAL IN ('1', '2'); | ||
| SELECT * FROM t WHERE x GLOBAL IN ([1, 2], [3]); | ||
| SELECT * FROM t WHERE arr[1] GLOBAL IN (1, 2); | ||
| SELECT * FROM t WHERE tup.1 GLOBAL IN (1, 2); | ||
| SELECT * FROM t WHERE NOT x GLOBAL IN (1, 2); | ||
| SELECT * FROM t WHERE NOT (x GLOBAL NOT IN (1, 2)); | ||
| SELECT * FROM t WHERE x GLOBAL IN (1) AND y = 2 OR z GLOBAL NOT IN (3) AND w = 4; | ||
| SELECT * FROM t WHERE a = 1 OR x GLOBAL IN (1) AND y BETWEEN 1 AND 2; | ||
| SELECT * FROM t WHERE (x GLOBAL IN (1)) IS NULL; | ||
| SELECT * FROM t WHERE (x GLOBAL IN (1)) = (y GLOBAL IN (2)); | ||
| SELECT * FROM t WHERE x GLOBAL IN (1) AND y IN (2) AND z NOT IN (3) AND w GLOBAL NOT IN (4); | ||
| SELECT * FROM t WHERE x GLOBAL IN (1) AND EXISTS (SELECT 1 FROM u WHERE u.x GLOBAL IN (1)); | ||
| SELECT x GLOBAL IN (1, 2) AS flag, x GLOBAL NOT IN (SELECT y FROM t2) FROM t; | ||
| SELECT CASE WHEN x GLOBAL IN (1, 2) THEN 'a' WHEN x GLOBAL NOT IN (SELECT y FROM t2) THEN 'b' ELSE 'c' END FROM t; | ||
| SELECT if(x GLOBAL IN (1), 1, 0), multiIf(x GLOBAL NOT IN (2), 1, 0) FROM t; | ||
| SELECT count() FROM t GROUP BY x GLOBAL IN (1, 2) HAVING count() GLOBAL IN (SELECT c FROM counts); | ||
| SELECT * FROM t ORDER BY x GLOBAL IN (1, 2) DESC, y GLOBAL NOT IN (3) ASC LIMIT 10; | ||
| SELECT * FROM t PREWHERE x GLOBAL IN (SELECT y FROM t2) WHERE z GLOBAL NOT IN (1); | ||
| SELECT * FROM t JOIN u ON t.x = u.x AND u.y GLOBAL IN (SELECT y FROM t2); | ||
| SELECT * FROM t LEFT JOIN u ON t.x GLOBAL IN (1, 2) WHERE u.y GLOBAL NOT IN (3); | ||
| SELECT * FROM t ARRAY JOIN arr WHERE arr GLOBAL IN (1, 2); | ||
| SELECT arrayFilter(v -> v GLOBAL IN (1, 2), arr) FROM t; | ||
| SELECT * FROM (SELECT * FROM t WHERE x GLOBAL IN (1)) AS sub WHERE sub.x GLOBAL NOT IN (2); | ||
| WITH c AS (SELECT 1 AS v) SELECT * FROM t WHERE x GLOBAL IN (SELECT v FROM c); | ||
| SELECT * FROM t WHERE x GLOBAL IN (1, 2) SETTINGS max_threads = 1; | ||
| SELECT * FROM t WHERE x GLOBAL IN (1) UNION ALL SELECT * FROM t WHERE x GLOBAL NOT IN (2); | ||
| SELECT * FROM t WHERE x GLOBAL IN (SELECT y FROM t2) ORDER BY x LIMIT 1 BY x; | ||
| SELECT sum(x) OVER (PARTITION BY y GLOBAL IN (1, 2)) FROM t; | ||
| INSERT INTO t2 SELECT * FROM t WHERE x GLOBAL IN (1, 2); | ||
| DELETE FROM t WHERE x GLOBAL IN (SELECT y FROM t2); | ||
| UPDATE t SET y = 1 WHERE x GLOBAL IN (SELECT y FROM t2); | ||
| CREATE VIEW v AS SELECT * FROM t WHERE x GLOBAL IN (1, 2); | ||
| SELECT /* GLOBAL IN */ * FROM t WHERE x GLOBAL -- NOT | ||
| IN (1, 2); | ||
| SELECT * FROM t WHERE x | ||
| GLOBAL | ||
| NOT | ||
| IN | ||
| (1, | ||
| 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some red tests