-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement physical plan for IN Subquery #1835
Labels
enhancement
New feature or request
Comments
Probably a dupe of #1209 |
andygrove
changed the title
Implement In Subquery
Implement physical plan for IN Subquery
Apr 27, 2022
I think this has already done. ❯ explain select t1_id from t1 where t1_id in (select t2_id from t2);
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| plan_type | plan |
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| logical_plan | LeftSemi Join: t1.t1_id = __correlated_sq_1.t2_id |
| | TableScan: t1 projection=[t1_id] |
| | SubqueryAlias: __correlated_sq_1 |
| | Projection: t2.t2_id AS t2_id |
| | TableScan: t2 projection=[t2_id] |
...
❯ explain select t1_id from t1 where t1_id in (select t2_id from t2 where t2_int > t1_int);
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| plan_type | plan |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| logical_plan | Projection: t1.t1_id |
| | LeftSemi Join: t1.t1_id = __correlated_sq_2.t2_id Filter: __correlated_sq_2.t2_int > t1.t1_int |
| | TableScan: t1 projection=[t1_id, t1_int] |
| | SubqueryAlias: __correlated_sq_2 |
| | Projection: t2.t2_id AS t2_id, t2.t2_int |
| | TableScan: t2 projection=[t2_id, t2_int] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Implement subqueries like
Describe the solution you'd like
It would be nice to use a SEMI join for this, something like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: